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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_activation_client.cc

Issue 11419251: Removes the |event| parameter from ActivationDelegate::ShouldActivate and makes the method const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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
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/widget/desktop_aura/desktop_activation_client.h" 5 #include "ui/views/widget/desktop_aura/desktop_activation_client.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "ui/aura/client/activation_delegate.h" 9 #include "ui/aura/client/activation_delegate.h"
10 #include "ui/aura/client/activation_change_observer.h" 10 #include "ui/aura/client/activation_change_observer.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 137
138 void DesktopActivationClient::OnWindowFocused(aura::Window* window) { 138 void DesktopActivationClient::OnWindowFocused(aura::Window* window) {
139 ActivateWindow(GetActivatableWindow(window)); 139 ActivateWindow(GetActivatableWindow(window));
140 } 140 }
141 141
142 bool DesktopActivationClient::CanActivateWindow(aura::Window* window) const { 142 bool DesktopActivationClient::CanActivateWindow(aura::Window* window) const {
143 return window && 143 return window &&
144 window->IsVisible() && 144 window->IsVisible() &&
145 (!aura::client::GetActivationDelegate(window) || 145 (!aura::client::GetActivationDelegate(window) ||
146 aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)); 146 aura::client::GetActivationDelegate(window)->ShouldActivate());
147 } 147 }
148 148
149 ui::EventResult DesktopActivationClient::OnKeyEvent(ui::KeyEvent* event) { 149 ui::EventResult DesktopActivationClient::OnKeyEvent(ui::KeyEvent* event) {
150 return ui::ER_UNHANDLED; 150 return ui::ER_UNHANDLED;
151 } 151 }
152 152
153 ui::EventResult DesktopActivationClient::OnMouseEvent(ui::MouseEvent* event) { 153 ui::EventResult DesktopActivationClient::OnMouseEvent(ui::MouseEvent* event) {
154 if (event->type() == ui::ET_MOUSE_PRESSED) 154 if (event->type() == ui::ET_MOUSE_PRESSED)
155 FocusWindowWithEvent(event); 155 FocusWindowWithEvent(event);
156 return ui::ER_UNHANDLED; 156 return ui::ER_UNHANDLED;
(...skipping 18 matching lines...) Expand all
175 175
176 void DesktopActivationClient::FocusWindowWithEvent(const ui::Event* event) { 176 void DesktopActivationClient::FocusWindowWithEvent(const ui::Event* event) {
177 aura::Window* window = static_cast<aura::Window*>(event->target()); 177 aura::Window* window = static_cast<aura::Window*>(event->target());
178 if (GetActiveWindow() != window) { 178 if (GetActiveWindow() != window) {
179 aura::client::GetFocusClient(window)->FocusWindow( 179 aura::client::GetFocusClient(window)->FocusWindow(
180 FindFocusableWindowFor(window), event); 180 FindFocusableWindowFor(window), event);
181 } 181 }
182 } 182 }
183 183
184 } // namespace views 184 } // namespace views
OLDNEW
« no previous file with comments | « ui/aura/client/activation_delegate.h ('k') | ui/views/widget/desktop_aura/desktop_native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698