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

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

Issue 2718333002: Move ash_util functions from 'chrome' namespace to 'ash_util' namespace (Closed)
Patch Set: Rebase after https://codereview.chromium.org/2721883002 Created 3 years, 9 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_util.h ('k') | chrome/browser/ui/ash/system_tray_client.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/common/mojo_interface_factory.h" 8 #include "ash/common/mojo_interface_factory.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 DISALLOW_COPY_AND_ASSIGN(EmbeddedAshService); 47 DISALLOW_COPY_AND_ASSIGN(EmbeddedAshService);
48 }; 48 };
49 49
50 } // namespace 50 } // namespace
51 51
52 std::unique_ptr<service_manager::Service> CreateEmbeddedAshService( 52 std::unique_ptr<service_manager::Service> CreateEmbeddedAshService(
53 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { 53 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
54 return base::MakeUnique<EmbeddedAshService>(task_runner); 54 return base::MakeUnique<EmbeddedAshService>(task_runner);
55 } 55 }
56 56
57 } // namespace ash_util
58
59 namespace chrome {
60
61 bool ShouldOpenAshOnStartup() { 57 bool ShouldOpenAshOnStartup() {
62 return !IsRunningInMash(); 58 return !IsRunningInMash();
63 } 59 }
64 60
65 bool IsRunningInMash() { 61 bool IsRunningInMash() {
66 return service_manager::ServiceManagerIsRemote(); 62 return service_manager::ServiceManagerIsRemote();
67 } 63 }
68 64
69 bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator) { 65 bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator) {
70 // When running in mash the browser doesn't handle ash accelerators. 66 // When running in mash the browser doesn't handle ash accelerators.
71 if (chrome::IsRunningInMash()) 67 if (IsRunningInMash())
72 return false; 68 return false;
73 69
74 return ash::WmShell::Get()->accelerator_controller()->IsDeprecated( 70 return ash::WmShell::Get()->accelerator_controller()->IsDeprecated(
75 accelerator); 71 accelerator);
76 } 72 }
77 73
78 } // namespace chrome 74 } // namespace ash_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/ash_util.h ('k') | chrome/browser/ui/ash/system_tray_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698