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

Unified Diff: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc

Issue 11885030: Enable the FocusController on DesktopAura too. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
===================================================================
--- ui/views/widget/desktop_aura/desktop_root_window_host_win.cc (revision 180150)
+++ ui/views/widget/desktop_aura/desktop_root_window_host_win.cc (working copy)
@@ -19,12 +19,15 @@
#include "ui/native_theme/native_theme_aura.h"
#include "ui/native_theme/native_theme_win.h"
#include "ui/views/corewm/compound_event_filter.h"
+#include "ui/views/corewm/corewm_switches.h"
+#include "ui/views/corewm/focus_controller.h"
#include "ui/views/corewm/input_method_event_filter.h"
#include "ui/views/ime/input_method_bridge.h"
#include "ui/views/widget/desktop_aura/desktop_activation_client.h"
#include "ui/views/widget/desktop_aura/desktop_cursor_client.h"
#include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h"
#include "ui/views/widget/desktop_aura/desktop_drag_drop_client_win.h"
+#include "ui/views/widget/desktop_aura/desktop_focus_rules.h"
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
#include "ui/views/widget/desktop_aura/desktop_screen_position_client.h"
#include "ui/views/widget/root_view.h"
@@ -54,6 +57,10 @@
}
DesktopRootWindowHostWin::~DesktopRootWindowHostWin() {
+ if (corewm::UseFocusControllerOnDesktop()) {
+ aura::client::SetFocusClient(root_window_, NULL);
+ aura::client::SetActivationClient(root_window_, NULL);
+ }
}
// static
@@ -118,11 +125,19 @@
capture_client_.reset(new aura::client::DefaultCaptureClient(root_window_));
aura::client::SetCaptureClient(root_window_, capture_client_.get());
- focus_client_.reset(new aura::FocusManager);
- aura::client::SetFocusClient(root_window_, focus_client_.get());
+ if (corewm::UseFocusControllerOnDesktop()) {
+ corewm::FocusController* focus_controller =
+ new corewm::FocusController(new DesktopFocusRules);
+ focus_client_.reset(focus_controller);
+ aura::client::SetFocusClient(root_window_, focus_controller);
+ aura::client::SetActivationClient(root_window_, focus_controller);
+ root_window_->AddPreTargetHandler(focus_controller);
+ } else {
+ focus_client_.reset(new aura::FocusManager);
+ aura::client::SetFocusClient(root_window_, focus_client_.get());
+ activation_client_.reset(new DesktopActivationClient(root_window_));
+ }
- activation_client_.reset(new DesktopActivationClient(root_window_));
-
dispatcher_client_.reset(new DesktopDispatcherClient);
aura::client::SetDispatcherClient(root_window_,
dispatcher_client_.get());
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_linux.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698