summaryrefslogtreecommitdiff
path: root/chromium/ui/wm
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/wm')
-rw-r--r--chromium/ui/wm/BUILD.gn6
-rw-r--r--chromium/ui/wm/core/compound_event_filter.cc11
-rw-r--r--chromium/ui/wm/core/compound_event_filter_unittest.cc6
-rw-r--r--chromium/ui/wm/core/cursor_manager.cc30
-rw-r--r--chromium/ui/wm/core/cursor_manager.h3
-rw-r--r--chromium/ui/wm/core/default_activation_client.h1
-rw-r--r--chromium/ui/wm/core/focus_controller_unittest.cc49
-rw-r--r--chromium/ui/wm/core/transient_window_manager.cc4
-rw-r--r--chromium/ui/wm/core/visibility_controller.h1
-rw-r--r--chromium/ui/wm/core/window_animations.cc8
-rw-r--r--chromium/ui/wm/core/window_animations.h2
-rw-r--r--chromium/ui/wm/public/scoped_tooltip_disabler.cc4
-rw-r--r--chromium/ui/wm/public/scoped_tooltip_disabler.h8
13 files changed, 77 insertions, 56 deletions
diff --git a/chromium/ui/wm/BUILD.gn b/chromium/ui/wm/BUILD.gn
index 2281a7eaf84..65c85f5baad 100644
--- a/chromium/ui/wm/BUILD.gn
+++ b/chromium/ui/wm/BUILD.gn
@@ -69,7 +69,7 @@ jumbo_component("wm") {
"//skia",
"//ui/aura",
"//ui/base",
- "//ui/base/cursor",
+ "//ui/base/cursor:cursor_base",
"//ui/base/cursor/mojom:cursor_type",
"//ui/base/ime",
"//ui/compositor",
@@ -103,7 +103,7 @@ jumbo_static_library("test_support") {
"test/wm_test_helper.h",
]
- public_deps = [ "//ui/base/cursor" ]
+ public_deps = [ "//ui/base/cursor:cursor_base" ]
deps = [
":wm",
@@ -144,7 +144,7 @@ test("wm_unittests") {
"//testing/gtest",
"//ui/aura:test_support",
"//ui/base:test_support",
- "//ui/base/cursor",
+ "//ui/base/cursor:cursor_base",
"//ui/base/cursor/mojom:cursor_type",
"//ui/base/ime",
"//ui/compositor:test_support",
diff --git a/chromium/ui/wm/core/compound_event_filter.cc b/chromium/ui/wm/core/compound_event_filter.cc
index 62906aedc3e..12bba293428 100644
--- a/chromium/ui/wm/core/compound_event_filter.cc
+++ b/chromium/ui/wm/core/compound_event_filter.cc
@@ -110,7 +110,12 @@ void CompoundEventFilter::UpdateCursor(aura::Window* target,
return;
}
}
- cursor_client->SetCursor(cursor);
+ // For ET_MOUSE_ENTERED, force the update of the cursor because it may have
+ // changed without |cursor_client| knowing about it.
+ if (event->type() == ui::ET_MOUSE_ENTERED)
+ cursor_client->SetCursorForced(cursor);
+ else
+ cursor_client->SetCursor(cursor);
}
}
@@ -229,8 +234,10 @@ void CompoundEventFilter::OnTouchEvent(ui::TouchEvent* event) {
ShouldHideCursorOnTouch(*event)) {
aura::Window* target = static_cast<aura::Window*>(event->target());
DCHECK(target);
- if (!aura::Env::GetInstance()->IsMouseButtonDown())
+ if (!aura::Env::GetInstance()->IsMouseButtonDown()) {
SetMouseEventsEnableStateOnEvent(target, event, false);
+ SetCursorVisibilityOnEvent(target, event, false);
+ }
}
}
diff --git a/chromium/ui/wm/core/compound_event_filter_unittest.cc b/chromium/ui/wm/core/compound_event_filter_unittest.cc
index 3e1d5b4d604..51fcf0e53ec 100644
--- a/chromium/ui/wm/core/compound_event_filter_unittest.cc
+++ b/chromium/ui/wm/core/compound_event_filter_unittest.cc
@@ -127,6 +127,7 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0);
DispatchEventUsingWindowDispatcher(&mouse0);
EXPECT_TRUE(cursor_client.IsMouseEventsEnabled());
+ EXPECT_TRUE(cursor_client.IsCursorVisible());
// This press is required for the GestureRecognizer to associate a target
// with kTouchId
@@ -134,22 +135,26 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
DispatchEventUsingWindowDispatcher(&press0);
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
+ EXPECT_FALSE(cursor_client.IsCursorVisible());
ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 10), GetTime(),
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
DispatchEventUsingWindowDispatcher(&move);
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
+ EXPECT_FALSE(cursor_client.IsCursorVisible());
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), GetTime(),
ui::PointerDetails(ui::EventPointerType::kTouch, 1));
DispatchEventUsingWindowDispatcher(&release);
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
+ EXPECT_FALSE(cursor_client.IsCursorVisible());
ui::MouseEvent mouse1(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
gfx::Point(10, 10), ui::EventTimeForNow(), 0, 0);
// Move the cursor again. The cursor should be visible.
DispatchEventUsingWindowDispatcher(&mouse1);
EXPECT_TRUE(cursor_client.IsMouseEventsEnabled());
+ EXPECT_TRUE(cursor_client.IsCursorVisible());
// Now activate the window and press on it again.
ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(90, 90), GetTime(),
@@ -157,6 +162,7 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
GetActivationClient(root_window())->ActivateWindow(window.get());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
+ EXPECT_FALSE(cursor_client.IsCursorVisible());
aura::Env::GetInstance()->RemovePreTargetHandler(compound_filter.get());
}
#endif // defined(OS_CHROMEOS) || defined(OS_WIN)
diff --git a/chromium/ui/wm/core/cursor_manager.cc b/chromium/ui/wm/core/cursor_manager.cc
index 5f5200af888..99a14dacbd9 100644
--- a/chromium/ui/wm/core/cursor_manager.cc
+++ b/chromium/ui/wm/core/cursor_manager.cc
@@ -95,23 +95,17 @@ void CursorManager::ResetCursorVisibilityStateForTest() {
}
void CursorManager::SetCursor(gfx::NativeCursor cursor) {
- bool previously_visible = GetCursor().type() != ui::mojom::CursorType::kNone;
- state_on_unlock_->set_cursor(cursor);
- if (cursor_lock_count_ == 0 &&
- GetCursor() != state_on_unlock_->cursor()) {
- delegate_->SetCursor(state_on_unlock_->cursor(), this);
- bool is_visible = cursor.type() != ui::mojom::CursorType::kNone;
- if (is_visible != previously_visible) {
- for (auto& observer : observers_)
- observer.OnCursorVisibilityChanged(is_visible);
- }
- }
+ SetCursorImpl(cursor, /*forced=*/false);
}
gfx::NativeCursor CursorManager::GetCursor() const {
return current_state_->cursor();
}
+void CursorManager::SetCursorForced(gfx::NativeCursor cursor) {
+ SetCursorImpl(cursor, /*forced=*/true);
+}
+
void CursorManager::ShowCursor() {
last_cursor_visibility_state_ = true;
state_on_unlock_->SetVisible(true);
@@ -254,4 +248,18 @@ void CursorManager::CommitMouseEventsEnabled(bool enabled) {
current_state_->SetMouseEventsEnabled(enabled);
}
+void CursorManager::SetCursorImpl(gfx::NativeCursor cursor, bool forced) {
+ bool previously_visible = GetCursor().type() != ui::mojom::CursorType::kNone;
+ state_on_unlock_->set_cursor(cursor);
+ if (cursor_lock_count_ == 0 &&
+ (forced || GetCursor() != state_on_unlock_->cursor())) {
+ delegate_->SetCursor(state_on_unlock_->cursor(), this);
+ bool is_visible = cursor.type() != ui::mojom::CursorType::kNone;
+ if (is_visible != previously_visible) {
+ for (auto& observer : observers_)
+ observer.OnCursorVisibilityChanged(is_visible);
+ }
+ }
+}
+
} // namespace wm
diff --git a/chromium/ui/wm/core/cursor_manager.h b/chromium/ui/wm/core/cursor_manager.h
index 87a0868b8fd..4497ea7c577 100644
--- a/chromium/ui/wm/core/cursor_manager.h
+++ b/chromium/ui/wm/core/cursor_manager.h
@@ -46,6 +46,7 @@ class WM_CORE_EXPORT CursorManager : public aura::client::CursorClient,
// Overridden from aura::client::CursorClient:
void SetCursor(gfx::NativeCursor) override;
gfx::NativeCursor GetCursor() const override;
+ void SetCursorForced(gfx::NativeCursor) override;
void ShowCursor() override;
void HideCursor() override;
bool IsCursorVisible() const override;
@@ -70,6 +71,8 @@ class WM_CORE_EXPORT CursorManager : public aura::client::CursorClient,
void CommitCursorSize(ui::CursorSize cursor_size) override;
void CommitMouseEventsEnabled(bool enabled) override;
+ void SetCursorImpl(gfx::NativeCursor cursor, bool forced);
+
std::unique_ptr<NativeCursorManager> delegate_;
// Display where the cursor is located.
diff --git a/chromium/ui/wm/core/default_activation_client.h b/chromium/ui/wm/core/default_activation_client.h
index ff7817e04da..1da55c21fe5 100644
--- a/chromium/ui/wm/core/default_activation_client.h
+++ b/chromium/ui/wm/core/default_activation_client.h
@@ -8,7 +8,6 @@
#include <vector>
#include "base/compiler_specific.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "ui/aura/window_observer.h"
diff --git a/chromium/ui/wm/core/focus_controller_unittest.cc b/chromium/ui/wm/core/focus_controller_unittest.cc
index 9bc998639a0..5ae62683ac0 100644
--- a/chromium/ui/wm/core/focus_controller_unittest.cc
+++ b/chromium/ui/wm/core/focus_controller_unittest.cc
@@ -45,8 +45,8 @@ class FocusNotificationObserver : public ActivationChangeObserver,
activation_changed_count_(0),
focus_changed_count_(0),
reactivation_count_(0),
- reactivation_requested_window_(NULL),
- reactivation_actual_window_(NULL) {}
+ reactivation_requested_window_(nullptr),
+ reactivation_actual_window_(nullptr) {}
~FocusNotificationObserver() override {}
void ExpectCounts(int activation_changed_count, int focus_changed_count) {
@@ -260,7 +260,7 @@ class DeleteOnActivationChangeObserver : public ActivationChangeObserver,
// Overridden from WindowDeleter:
aura::Window* GetDeletedWindow() override {
- return did_delete_ ? window_ : NULL;
+ return did_delete_ ? window_ : nullptr;
}
private:
@@ -299,7 +299,7 @@ class DeleteOnLoseFocusChangeObserver
// Overridden from WindowDeleter:
aura::Window* GetDeletedWindow() override {
- return did_delete_ ? window_ : NULL;
+ return did_delete_ ? window_ : nullptr;
}
private:
@@ -338,8 +338,8 @@ class ScopedTargetFocusNotificationObserver : public FocusNotificationObserver {
}
~ScopedTargetFocusNotificationObserver() override {
if (tracker_.Contains(target_)) {
- SetActivationChangeObserver(target_, NULL);
- aura::client::SetFocusChangeObserver(target_, NULL);
+ SetActivationChangeObserver(target_, nullptr);
+ aura::client::SetFocusChangeObserver(target_, nullptr);
}
}
@@ -367,8 +367,7 @@ class SimpleEventHandler : public ui::EventHandler {
class FocusShiftingActivationObserver : public ActivationChangeObserver {
public:
explicit FocusShiftingActivationObserver(aura::Window* activated_window)
- : activated_window_(activated_window),
- shift_focus_to_(NULL) {}
+ : activated_window_(activated_window), shift_focus_to_(nullptr) {}
~FocusShiftingActivationObserver() override {}
void set_shift_focus_to(aura::Window* shift_focus_to) {
@@ -448,7 +447,7 @@ class ActivateWhileActivatingObserver : public ActivationChangeObserver {
// in tests for those FocusRules implementations.
class TestFocusRules : public BaseFocusRules {
public:
- TestFocusRules() : focus_restriction_(NULL) {}
+ TestFocusRules() : focus_restriction_(nullptr) {}
// Restricts focus and activation to this window and its child hierarchy.
void set_focus_restriction(aura::Window* focus_restriction) {
@@ -549,7 +548,7 @@ class FocusControllerTestBase : public aura::test::AuraTestBase {
void TearDown() override {
root_window()->RemovePreTargetHandler(focus_controller_.get());
aura::test::AuraTestBase::TearDown();
- test_focus_rules_ = NULL; // Owned by FocusController.
+ test_focus_rules_ = nullptr; // Owned by FocusController.
focus_controller_.reset();
}
@@ -640,21 +639,21 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase {
// Overridden from FocusControllerTestBase:
void BasicFocus() override {
- EXPECT_EQ(NULL, GetFocusedWindow());
+ EXPECT_FALSE(GetFocusedWindow());
FocusWindowById(1);
EXPECT_EQ(1, GetFocusedWindowId());
FocusWindowById(2);
EXPECT_EQ(2, GetFocusedWindowId());
}
void BasicActivation() override {
- EXPECT_EQ(NULL, GetActiveWindow());
+ EXPECT_FALSE(GetActiveWindow());
ActivateWindowById(1);
EXPECT_EQ(1, GetActiveWindowId());
ActivateWindowById(2);
EXPECT_EQ(2, GetActiveWindowId());
// Verify that attempting to deactivate NULL does not crash and does not
// change activation.
- DeactivateWindow(NULL);
+ DeactivateWindow(nullptr);
EXPECT_EQ(2, GetActiveWindowId());
DeactivateWindow(GetActiveWindow());
EXPECT_EQ(1, GetActiveWindowId());
@@ -775,7 +774,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase {
EXPECT_EQ(11, GetFocusedWindowId());
}
void FocusRulesOverride() override {
- EXPECT_EQ(NULL, GetFocusedWindow());
+ EXPECT_FALSE(GetFocusedWindow());
FocusWindowById(11);
EXPECT_EQ(11, GetFocusedWindowId());
@@ -786,7 +785,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase {
int focused_window = IsInputEvent() ? 11 : 211;
EXPECT_EQ(focused_window, GetFocusedWindowId());
- test_focus_rules()->set_focus_restriction(NULL);
+ test_focus_rules()->set_focus_restriction(nullptr);
FocusWindowById(12);
EXPECT_EQ(12, GetFocusedWindowId());
}
@@ -805,7 +804,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase {
EXPECT_EQ(active_window, GetActiveWindowId());
EXPECT_EQ(active_window, GetFocusedWindowId());
- test_focus_rules()->set_focus_restriction(NULL);
+ test_focus_rules()->set_focus_restriction(nullptr);
ActivateWindowById(2);
EXPECT_EQ(2, GetActiveWindowId());
EXPECT_EQ(2, GetFocusedWindowId());
@@ -840,7 +839,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase {
// Simulate a focus reset by the ActivationChangeObserver. This should
// trigger the default setting in FocusController.
- observer->set_shift_focus_to(NULL);
+ observer->set_shift_focus_to(nullptr);
ActivateWindowById(1);
EXPECT_EQ(1, GetFocusedWindowId());
@@ -1180,16 +1179,16 @@ class FocusControllerMouseEventTest : public FocusControllerDirectTestBase {
// Tests that a handled mouse or gesture event does not trigger a window
// activation.
void IgnoreHandledEvent() {
- EXPECT_EQ(NULL, GetActiveWindow());
+ EXPECT_FALSE(GetActiveWindow());
aura::Window* w1 = root_window()->GetChildById(1);
SimpleEventHandler handler;
root_window()->AddPreTargetHandler(&handler,
ui::EventTarget::Priority::kSystem);
ui::test::EventGenerator generator(root_window(), w1);
generator.ClickLeftButton();
- EXPECT_EQ(NULL, GetActiveWindow());
+ EXPECT_FALSE(GetActiveWindow());
generator.GestureTapAt(w1->bounds().CenterPoint());
- EXPECT_EQ(NULL, GetActiveWindow());
+ EXPECT_FALSE(GetActiveWindow());
root_window()->RemovePreTargetHandler(&handler);
generator.ClickLeftButton();
EXPECT_EQ(1, GetActiveWindowId());
@@ -1278,7 +1277,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase {
// Overridden from FocusControllerTestBase:
void BasicFocus() override {
- EXPECT_EQ(NULL, GetFocusedWindow());
+ EXPECT_FALSE(GetFocusedWindow());
aura::Window* w211 = root_window()->GetChildById(211);
FocusWindow(w211);
@@ -1291,7 +1290,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase {
void BasicActivation() override {
DCHECK(!parent_) << "Activation tests don't support parent changes.";
- EXPECT_EQ(NULL, GetActiveWindow());
+ EXPECT_FALSE(GetActiveWindow());
aura::Window* w2 = root_window()->GetChildById(2);
ActivateWindow(w2);
@@ -1335,7 +1334,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase {
observer3.ExpectCounts(1, 1);
}
void FocusRulesOverride() override {
- EXPECT_EQ(NULL, GetFocusedWindow());
+ EXPECT_FALSE(GetFocusedWindow());
aura::Window* w211 = root_window()->GetChildById(211);
FocusWindow(w211);
EXPECT_EQ(211, GetFocusedWindowId());
@@ -1346,7 +1345,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase {
// it to 11.
EXPECT_EQ(11, GetFocusedWindowId());
- test_focus_rules()->set_focus_restriction(NULL);
+ test_focus_rules()->set_focus_restriction(nullptr);
}
void ActivationRulesOverride() override {
DCHECK(!parent_) << "Activation tests don't support parent changes.";
@@ -1366,7 +1365,7 @@ class FocusControllerImplicitTestBase : public FocusControllerTestBase {
EXPECT_EQ(3, GetActiveWindowId());
EXPECT_EQ(3, GetFocusedWindowId());
- test_focus_rules()->set_focus_restriction(NULL);
+ test_focus_rules()->set_focus_restriction(nullptr);
ActivateWindow(root_window()->GetChildById(2));
EXPECT_EQ(2, GetActiveWindowId());
EXPECT_EQ(2, GetFocusedWindowId());
diff --git a/chromium/ui/wm/core/transient_window_manager.cc b/chromium/ui/wm/core/transient_window_manager.cc
index 64f74e0e9e9..e5fa6ea3623 100644
--- a/chromium/ui/wm/core/transient_window_manager.cc
+++ b/chromium/ui/wm/core/transient_window_manager.cc
@@ -114,8 +114,8 @@ bool TransientWindowManager::IsStackingTransient(
TransientWindowManager::TransientWindowManager(Window* window)
: window_(window),
- transient_parent_(NULL),
- stacking_target_(NULL),
+ transient_parent_(nullptr),
+ stacking_target_(nullptr),
parent_controls_visibility_(false),
show_on_parent_visible_(false),
ignore_visibility_changed_event_(false) {
diff --git a/chromium/ui/wm/core/visibility_controller.h b/chromium/ui/wm/core/visibility_controller.h
index 0f06bdc6d65..5833ee61035 100644
--- a/chromium/ui/wm/core/visibility_controller.h
+++ b/chromium/ui/wm/core/visibility_controller.h
@@ -6,7 +6,6 @@
#define UI_WM_CORE_VISIBILITY_CONTROLLER_H_
#include "base/compiler_specific.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "ui/aura/client/visibility_client.h"
#include "ui/wm/core/wm_core_export.h"
diff --git a/chromium/ui/wm/core/window_animations.cc b/chromium/ui/wm/core/window_animations.cc
index 08477b6bc94..f55ee90238e 100644
--- a/chromium/ui/wm/core/window_animations.cc
+++ b/chromium/ui/wm/core/window_animations.cc
@@ -90,7 +90,7 @@ class HidingWindowAnimationObserverBase : public aura::WindowObserver {
auto iter = std::find(window_->parent()->children().begin(),
window_->parent()->children().end(), window_);
DCHECK(iter != window_->parent()->children().end());
- aura::Window* topmost_transient_child = NULL;
+ aura::Window* topmost_transient_child = nullptr;
for (++iter; iter != window_->parent()->children().end(); ++iter) {
if (base::Contains(transient_children, *iter))
topmost_transient_child = *iter;
@@ -128,7 +128,7 @@ class HidingWindowAnimationObserverBase : public aura::WindowObserver {
layer_owner_->root()->SuppressPaint();
window_->RemoveObserver(this);
- window_ = NULL;
+ window_ = nullptr;
}
aura::Window* window_;
@@ -410,7 +410,7 @@ class RotateHidingWindowAnimationObserver
~RotateHidingWindowAnimationObserver() override {}
// Destroys itself after |last_sequence| ends or is aborted. Does not take
- // ownership of |last_sequence|, which should not be NULL.
+ // ownership of |last_sequence|, which should not be nullptr.
void SetLastSequence(ui::LayerAnimationSequence* last_sequence) {
last_sequence->AddObserver(this);
}
@@ -436,7 +436,7 @@ void AddLayerAnimationsForRotate(aura::Window* window, bool show) {
base::TimeDelta duration = base::TimeDelta::FromMilliseconds(
kWindowAnimation_Rotate_DurationMS);
- RotateHidingWindowAnimationObserver* observer = NULL;
+ RotateHidingWindowAnimationObserver* observer = nullptr;
if (!show) {
observer = new RotateHidingWindowAnimationObserver(window);
diff --git a/chromium/ui/wm/core/window_animations.h b/chromium/ui/wm/core/window_animations.h
index 2881b15fd52..4f425caa7aa 100644
--- a/chromium/ui/wm/core/window_animations.h
+++ b/chromium/ui/wm/core/window_animations.h
@@ -95,7 +95,7 @@ WM_CORE_EXPORT bool AnimateWindow(aura::Window* window,
WindowAnimationType type);
// Returns true if window animations are disabled for |window|. Window
-// animations are enabled by default. If |window| is NULL, this just checks
+// animations are enabled by default. If |window| is nullptr, this just checks
// if the global flag disabling window animations is present.
WM_CORE_EXPORT bool WindowAnimationsDisabled(aura::Window* window);
diff --git a/chromium/ui/wm/public/scoped_tooltip_disabler.cc b/chromium/ui/wm/public/scoped_tooltip_disabler.cc
index eb2d1c53b53..9b146237663 100644
--- a/chromium/ui/wm/public/scoped_tooltip_disabler.cc
+++ b/chromium/ui/wm/public/scoped_tooltip_disabler.cc
@@ -10,7 +10,7 @@
namespace wm {
ScopedTooltipDisabler::ScopedTooltipDisabler(aura::Window* window)
- : root_(window ? window->GetRootWindow() : NULL) {
+ : root_(window ? window->GetRootWindow() : nullptr) {
if (root_) {
root_->AddObserver(this);
TooltipClient* client = GetTooltipClient(root_);
@@ -30,7 +30,7 @@ void ScopedTooltipDisabler::EnableTooltips() {
if (client)
client->SetTooltipsEnabled(true);
root_->RemoveObserver(this);
- root_ = NULL;
+ root_ = nullptr;
}
void ScopedTooltipDisabler::OnWindowDestroying(aura::Window* window) {
diff --git a/chromium/ui/wm/public/scoped_tooltip_disabler.h b/chromium/ui/wm/public/scoped_tooltip_disabler.h
index 530aafd9a4d..dd46b575a7e 100644
--- a/chromium/ui/wm/public/scoped_tooltip_disabler.h
+++ b/chromium/ui/wm/public/scoped_tooltip_disabler.h
@@ -14,9 +14,9 @@ namespace wm {
// Use to temporarily disable tooltips.
class WM_PUBLIC_EXPORT ScopedTooltipDisabler : aura::WindowObserver {
public:
- // Disables tooltips on |window| (does nothing if |window| is NULL). Tooltips
- // are reenabled from the destructor when there are no most outstanding
- // ScopedTooltipDisablers for |window|.
+ // Disables tooltips on |window| (does nothing if |window| is nullptr).
+ // Tooltips are re-enabled from the destructor when there are no most
+ // outstanding ScopedTooltipDisablers for |window|.
explicit ScopedTooltipDisabler(aura::Window* window);
~ScopedTooltipDisabler() override;
@@ -27,7 +27,7 @@ class WM_PUBLIC_EXPORT ScopedTooltipDisabler : aura::WindowObserver {
// aura::WindowObserver:
void OnWindowDestroying(aura::Window* window) override;
- // The RootWindow to disable Tooltips on; NULL if the Window passed to the
+ // The RootWindow to disable Tooltips on; nullptr if the Window passed to the
// constructor was not in a root or the root has been destroyed.
aura::Window* root_;