Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Side by Side Diff: ui/views/corewm/focus_controller_unittest.cc

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/corewm/compound_event_filter.cc ('k') | ui/views/corewm/input_method_event_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/corewm/focus_controller.h" 5 #include "ui/views/corewm/focus_controller.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "ui/aura/client/activation_change_observer.h" 9 #include "ui/aura/client/activation_change_observer.h"
10 #include "ui/aura/client/activation_client.h" 10 #include "ui/aura/client/activation_client.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 private: 93 private:
94 aura::RootWindow* root_window_; 94 aura::RootWindow* root_window_;
95 95
96 DISALLOW_COPY_AND_ASSIGN(ScopedFocusNotificationObserver); 96 DISALLOW_COPY_AND_ASSIGN(ScopedFocusNotificationObserver);
97 }; 97 };
98 98
99 class ScopedTargetFocusNotificationObserver : public FocusNotificationObserver { 99 class ScopedTargetFocusNotificationObserver : public FocusNotificationObserver {
100 public: 100 public:
101 ScopedTargetFocusNotificationObserver(aura::RootWindow* root_window, int id) 101 ScopedTargetFocusNotificationObserver(aura::Window* root_window, int id)
102 : target_(root_window->GetChildById(id)) { 102 : target_(root_window->GetChildById(id)) {
103 aura::client::SetActivationChangeObserver(target_, this); 103 aura::client::SetActivationChangeObserver(target_, this);
104 aura::client::SetFocusChangeObserver(target_, this); 104 aura::client::SetFocusChangeObserver(target_, this);
105 tracker_.Add(target_); 105 tracker_.Add(target_);
106 } 106 }
107 virtual ~ScopedTargetFocusNotificationObserver() { 107 virtual ~ScopedTargetFocusNotificationObserver() {
108 if (tracker_.Contains(target_)) { 108 if (tracker_.Contains(target_)) {
109 aura::client::SetActivationChangeObserver(target_, NULL); 109 aura::client::SetActivationChangeObserver(target_, NULL);
110 aura::client::SetFocusChangeObserver(target_, NULL); 110 aura::client::SetFocusChangeObserver(target_, NULL);
111 } 111 }
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 DIRECT_FOCUS_CHANGE_TESTS(NoShiftActiveOnActivation); 1014 DIRECT_FOCUS_CHANGE_TESTS(NoShiftActiveOnActivation);
1015 1015
1016 // Clicking on a window which has capture should not result in a focus change. 1016 // Clicking on a window which has capture should not result in a focus change.
1017 DIRECT_FOCUS_CHANGE_TESTS(NoFocusChangeOnClickOnCaptureWindow); 1017 DIRECT_FOCUS_CHANGE_TESTS(NoFocusChangeOnClickOnCaptureWindow);
1018 1018
1019 FOCUS_CONTROLLER_TEST(FocusControllerApiTest, 1019 FOCUS_CONTROLLER_TEST(FocusControllerApiTest,
1020 ChangeFocusWhenNothingFocusedAndCaptured); 1020 ChangeFocusWhenNothingFocusedAndCaptured);
1021 1021
1022 } // namespace corewm 1022 } // namespace corewm
1023 } // namespace views 1023 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/corewm/compound_event_filter.cc ('k') | ui/views/corewm/input_method_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698