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

Side by Side Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2319783002: mash: Allow a subset of D-Bus clients to be created in DBusThreadManager (Closed)
Patch Set: WIP, add DBusThreadManagerAsh and DBusThreadManagerChrome Created 4 years, 3 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
« no previous file with comments | « ash/common/DEPS ('k') | ash/common/dbus_thread_manager_ash.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 "ash/common/accelerators/accelerator_controller.h" 5 #include "ash/common/accelerators/accelerator_controller.h"
6 6
7 #include "ash/common/accelerators/accelerator_commands.h" 7 #include "ash/common/accelerators/accelerator_commands.h"
8 #include "ash/common/accelerators/accelerator_controller_delegate.h" 8 #include "ash/common/accelerators/accelerator_controller_delegate.h"
9 #include "ash/common/accelerators/debug_commands.h" 9 #include "ash/common/accelerators/debug_commands.h"
10 #include "ash/common/accessibility_delegate.h" 10 #include "ash/common/accessibility_delegate.h"
(...skipping 23 matching lines...) Expand all
34 #include "ash/common/wm_root_window_controller.h" 34 #include "ash/common/wm_root_window_controller.h"
35 #include "ash/common/wm_shell.h" 35 #include "ash/common/wm_shell.h"
36 #include "ash/common/wm_window.h" 36 #include "ash/common/wm_window.h"
37 #include "base/metrics/histogram_macros.h" 37 #include "base/metrics/histogram_macros.h"
38 #include "base/metrics/user_metrics.h" 38 #include "base/metrics/user_metrics.h"
39 #include "ui/base/accelerators/accelerator.h" 39 #include "ui/base/accelerators/accelerator.h"
40 #include "ui/base/accelerators/accelerator_manager.h" 40 #include "ui/base/accelerators/accelerator_manager.h"
41 #include "ui/keyboard/keyboard_controller.h" 41 #include "ui/keyboard/keyboard_controller.h"
42 42
43 #if defined(OS_CHROMEOS) 43 #if defined(OS_CHROMEOS)
44 #include "ash/common/dbus_thread_manager_ash.h"
44 #include "ash/common/palette_delegate.h" 45 #include "ash/common/palette_delegate.h"
45 #include "ash/common/shelf/wm_shelf.h" 46 #include "ash/common/shelf/wm_shelf.h"
46 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" 47 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
47 #include "ash/common/system/chromeos/palette/palette_tray.h" 48 #include "ash/common/system/chromeos/palette/palette_tray.h"
48 #include "ash/common/system/chromeos/palette/palette_utils.h" 49 #include "ash/common/system/chromeos/palette/palette_utils.h"
49 #include "ash/common/system/status_area_widget.h" 50 #include "ash/common/system/status_area_widget.h"
50 #include "ash/common/wm_root_window_controller.h" 51 #include "ash/common/wm_root_window_controller.h"
51 #include "ash/common/wm_window.h" 52 #include "ash/common/wm_window.h"
52 #include "chromeos/dbus/dbus_thread_manager.h" 53 // #include "chromeos/dbus/dbus_thread_manager.h"
53 #include "chromeos/dbus/power_manager_client.h" 54 #include "chromeos/dbus/power_manager_client.h"
54 #include "ui/base/ime/chromeos/ime_keyboard.h" 55 #include "ui/base/ime/chromeos/ime_keyboard.h"
55 #include "ui/base/ime/chromeos/input_method_manager.h" 56 #include "ui/base/ime/chromeos/input_method_manager.h"
56 #endif // defined(OS_CHROMEOS) 57 #endif // defined(OS_CHROMEOS)
57 58
58 namespace ash { 59 namespace ash {
59 namespace { 60 namespace {
60 61
61 using base::UserMetricsAction; 62 using base::UserMetricsAction;
62 63
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 palette_tray->ShowPalette(); 414 palette_tray->ShowPalette();
414 } 415 }
415 416
416 bool CanHandleShowStylusTools() { 417 bool CanHandleShowStylusTools() {
417 return WmShell::Get()->palette_delegate() && 418 return WmShell::Get()->palette_delegate() &&
418 WmShell::Get()->palette_delegate()->ShouldShowPalette(); 419 WmShell::Get()->palette_delegate()->ShouldShowPalette();
419 } 420 }
420 421
421 void HandleSuspend() { 422 void HandleSuspend() {
422 base::RecordAction(UserMetricsAction("Accel_Suspend")); 423 base::RecordAction(UserMetricsAction("Accel_Suspend"));
423 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestSuspend(); 424 DBusThreadManagerAsh::Get()->GetPowerManagerClient()->RequestSuspend();
424 } 425 }
425 426
426 bool CanHandleCycleUser() { 427 bool CanHandleCycleUser() {
427 return WmShell::Get()->delegate()->IsMultiProfilesEnabled() && 428 return WmShell::Get()->delegate()->IsMultiProfilesEnabled() &&
428 WmShell::Get()->GetSessionStateDelegate()->NumberOfLoggedInUsers() > 1; 429 WmShell::Get()->GetSessionStateDelegate()->NumberOfLoggedInUsers() > 1;
429 } 430 }
430 431
431 void HandleCycleUser(SessionStateDelegate::CycleUser cycle_user) { 432 void HandleCycleUser(SessionStateDelegate::CycleUser cycle_user) {
432 MultiProfileUMA::RecordSwitchActiveUser( 433 MultiProfileUMA::RecordSwitchActiveUser(
433 MultiProfileUMA::SWITCH_ACTIVE_USER_BY_ACCELERATOR); 434 MultiProfileUMA::SWITCH_ACTIVE_USER_BY_ACCELERATOR);
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && 1106 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() &&
1106 actions_needing_window_.find(action) != actions_needing_window_.end()) { 1107 actions_needing_window_.find(action) != actions_needing_window_.end()) {
1107 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( 1108 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert(
1108 A11Y_ALERT_WINDOW_NEEDED); 1109 A11Y_ALERT_WINDOW_NEEDED);
1109 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; 1110 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
1110 } 1111 }
1111 return RESTRICTION_NONE; 1112 return RESTRICTION_NONE;
1112 } 1113 }
1113 1114
1114 } // namespace ash 1115 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/DEPS ('k') | ash/common/dbus_thread_manager_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698