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

Side by Side Diff: chrome/browser/ui/ash/ash_util.cc

Issue 2170753005: Moves AcceleratorController from Shell to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include Created 4 years, 5 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 | « chrome/browser/ui/ash/ash_init.cc ('k') | chrome/browser/ui/views/chrome_views_delegate.cc » ('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 "chrome/browser/ui/ash/ash_util.h" 5 #include "chrome/browser/ui/ash/ash_util.h"
6 6
7 #include "ash/common/accelerators/accelerator_controller.h" 7 #include "ash/common/accelerators/accelerator_controller.h"
8 #include "ash/shell.h" 8 #include "ash/common/wm_shell.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/ui/ash/ash_init.h" 10 #include "chrome/browser/ui/ash/ash_init.h"
11 #include "ui/aura/window_event_dispatcher.h" 11 #include "ui/aura/window_event_dispatcher.h"
12 12
13 #if defined(MOJO_SHELL_CLIENT) 13 #if defined(MOJO_SHELL_CLIENT)
14 #include "services/shell/runner/common/client_util.h" 14 #include "services/shell/runner/common/client_util.h"
15 #endif 15 #endif
16 16
17 namespace chrome { 17 namespace chrome {
18 18
19 bool ShouldOpenAshOnStartup() { 19 bool ShouldOpenAshOnStartup() {
20 return !IsRunningInMash(); 20 return !IsRunningInMash();
21 } 21 }
22 22
23 bool IsRunningInMash() { 23 bool IsRunningInMash() {
24 #if defined(MOJO_SHELL_CLIENT) 24 #if defined(MOJO_SHELL_CLIENT)
25 return shell::ShellIsRemote(); 25 return shell::ShellIsRemote();
26 #else 26 #else
27 return false; 27 return false;
28 #endif 28 #endif
29 } 29 }
30 30
31 bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator) { 31 bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator) {
32 // When running in mash the browser doesn't handle ash accelerators. 32 // When running in mash the browser doesn't handle ash accelerators.
33 if (chrome::IsRunningInMash()) 33 if (chrome::IsRunningInMash())
34 return false; 34 return false;
35 35
36 ash::AcceleratorController* controller = 36 return ash::WmShell::Get()->accelerator_controller()->IsDeprecated(
37 ash::Shell::GetInstance()->accelerator_controller(); 37 accelerator);
38 return controller->IsDeprecated(accelerator);
39 } 38 }
40 39
41 } // namespace chrome 40 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/ash_init.cc ('k') | chrome/browser/ui/views/chrome_views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698