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

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

Issue 1177773002: Deprecating high-conflict accelerators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moving IsDeprecated() to c/b/ui/ash Created 5 years, 6 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
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/accelerators/accelerator_controller.h"
7 #include "ash/shell.h" 8 #include "ash/shell.h"
8 #include "chrome/browser/ui/ash/ash_init.h" 9 #include "chrome/browser/ui/ash/ash_init.h"
9 #include "chrome/browser/ui/host_desktop.h" 10 #include "chrome/browser/ui/host_desktop.h"
10 #include "ui/aura/window_event_dispatcher.h" 11 #include "ui/aura/window_event_dispatcher.h"
11 12
12 #if !defined(OS_CHROMEOS) 13 #if !defined(OS_CHROMEOS)
13 #include "base/command_line.h" 14 #include "base/command_line.h"
14 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
15 #endif 16 #endif
16 17
(...skipping 26 matching lines...) Expand all
43 return true; 44 return true;
44 } 45 }
45 46
46 return false; 47 return false;
47 } 48 }
48 49
49 bool IsNativeWindowInAsh(gfx::NativeWindow native_window) { 50 bool IsNativeWindowInAsh(gfx::NativeWindow native_window) {
50 return IsNativeViewInAsh(native_window); 51 return IsNativeViewInAsh(native_window);
51 } 52 }
52 53
54 bool IsAcceleratorDeprecated(const ui::Accelerator accelerator) {
55 if (!ash::Shell::HasInstance())
56 return false;
oshima 2015/06/19 21:21:45 this shouldn't be nullptr too.
afakhry 2015/06/19 22:14:19 Done. However there's a similar test for this case
57
58 ash::AcceleratorController* controller =
sky 2015/06/19 21:00:48 Do we really allow this to be null?
afakhry 2015/06/19 22:14:19 Done.
59 ash::Shell::GetInstance()->accelerator_controller();
60
61 if (!controller)
62 return false;
63
64 return controller->IsDeprecated(accelerator);
65 }
66
53 } // namespace chrome 67 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698