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

Side by Side Diff: ash/test/test_shell_delegate.cc

Issue 2827193004: Make PrefService available in *ash (Closed)
Patch Set: Adding NOTREACHED() comment. Created 3 years, 7 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/test/test_shell_delegate.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate.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/test/test_shell_delegate.h" 5 #include "ash/test/test_shell_delegate.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "ash/default_accessibility_delegate.h" 9 #include "ash/default_accessibility_delegate.h"
10 #include "ash/gpu_support_stub.h" 10 #include "ash/gpu_support_stub.h"
11 #include "ash/palette_delegate.h" 11 #include "ash/palette_delegate.h"
12 #include "ash/public/cpp/shell_window_ids.h" 12 #include "ash/public/cpp/shell_window_ids.h"
13 #include "ash/root_window_controller.h" 13 #include "ash/root_window_controller.h"
14 #include "ash/session/session_state_delegate.h" 14 #include "ash/session/session_state_delegate.h"
15 #include "ash/shelf/wm_shelf.h" 15 #include "ash/shelf/wm_shelf.h"
16 #include "ash/shell.h" 16 #include "ash/shell.h"
17 #include "ash/shell_observer.h" 17 #include "ash/shell_observer.h"
18 #include "ash/system/tray/system_tray_notifier.h" 18 #include "ash/system/tray/system_tray_notifier.h"
19 #include "ash/test/test_keyboard_ui.h" 19 #include "ash/test/test_keyboard_ui.h"
20 #include "ash/test/test_session_state_delegate.h" 20 #include "ash/test/test_session_state_delegate.h"
21 #include "ash/test/test_system_tray_delegate.h" 21 #include "ash/test/test_system_tray_delegate.h"
22 #include "ash/test/test_wallpaper_delegate.h" 22 #include "ash/test/test_wallpaper_delegate.h"
23 #include "ash/wm/window_state.h" 23 #include "ash/wm/window_state.h"
24 #include "ash/wm/window_util.h" 24 #include "ash/wm/window_util.h"
25 #include "ash/wm_window.h" 25 #include "ash/wm_window.h"
26 #include "base/logging.h" 26 #include "base/logging.h"
27 #include "base/memory/ptr_util.h" 27 #include "base/memory/ptr_util.h"
28 #include "components/prefs/pref_service.h"
29 #include "components/prefs/testing_pref_service.h"
28 #include "ui/aura/window.h" 30 #include "ui/aura/window.h"
29 #include "ui/gfx/image/image.h" 31 #include "ui/gfx/image/image.h"
30 32
31 namespace ash { 33 namespace ash {
32 namespace test { 34 namespace test {
33 35
34 // A ShellObserver that sets the shelf alignment and auto hide behavior when the 36 // A ShellObserver that sets the shelf alignment and auto hide behavior when the
35 // shelf is created, to simulate ChromeLauncherController's behavior. 37 // shelf is created, to simulate ChromeLauncherController's behavior.
36 class ShelfInitializer : public ShellObserver { 38 class ShelfInitializer : public ShellObserver {
37 public: 39 public:
(...skipping 13 matching lines...) Expand all
51 } 53 }
52 54
53 private: 55 private:
54 DISALLOW_COPY_AND_ASSIGN(ShelfInitializer); 56 DISALLOW_COPY_AND_ASSIGN(ShelfInitializer);
55 }; 57 };
56 58
57 TestShellDelegate::TestShellDelegate() 59 TestShellDelegate::TestShellDelegate()
58 : num_exit_requests_(0), 60 : num_exit_requests_(0),
59 multi_profiles_enabled_(false), 61 multi_profiles_enabled_(false),
60 force_maximize_on_first_run_(false), 62 force_maximize_on_first_run_(false),
61 touchscreen_enabled_in_local_pref_(true) {} 63 touchscreen_enabled_in_local_pref_(true),
64 pref_service_(base::MakeUnique<TestingPrefServiceSimple>()) {}
62 65
63 TestShellDelegate::~TestShellDelegate() {} 66 TestShellDelegate::~TestShellDelegate() {}
64 67
65 ::service_manager::Connector* TestShellDelegate::GetShellConnector() const { 68 ::service_manager::Connector* TestShellDelegate::GetShellConnector() const {
66 return nullptr; 69 return nullptr;
67 } 70 }
68 71
69 bool TestShellDelegate::IsIncognitoAllowed() const { 72 bool TestShellDelegate::IsIncognitoAllowed() const {
70 return true; 73 return true;
71 } 74 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 143 }
141 144
142 base::string16 TestShellDelegate::GetProductName() const { 145 base::string16 TestShellDelegate::GetProductName() const {
143 return base::string16(); 146 return base::string16();
144 } 147 }
145 148
146 gfx::Image TestShellDelegate::GetDeprecatedAcceleratorImage() const { 149 gfx::Image TestShellDelegate::GetDeprecatedAcceleratorImage() const {
147 return gfx::Image(); 150 return gfx::Image();
148 } 151 }
149 152
153 PrefService* TestShellDelegate::GetActiveUserPrefService() const {
154 return pref_service_.get();
155 }
156
150 bool TestShellDelegate::IsTouchscreenEnabledInPrefs( 157 bool TestShellDelegate::IsTouchscreenEnabledInPrefs(
151 bool use_local_state) const { 158 bool use_local_state) const {
152 return use_local_state ? touchscreen_enabled_in_local_pref_ : true; 159 return use_local_state ? touchscreen_enabled_in_local_pref_ : true;
153 } 160 }
154 161
155 void TestShellDelegate::SetTouchscreenEnabledInPrefs(bool enabled, 162 void TestShellDelegate::SetTouchscreenEnabledInPrefs(bool enabled,
156 bool use_local_state) { 163 bool use_local_state) {
157 if (use_local_state) 164 if (use_local_state)
158 touchscreen_enabled_in_local_pref_ = enabled; 165 touchscreen_enabled_in_local_pref_ = enabled;
159 } 166 }
160 167
161 void TestShellDelegate::UpdateTouchscreenStatusFromPrefs() {} 168 void TestShellDelegate::UpdateTouchscreenStatusFromPrefs() {}
162 169
163 } // namespace test 170 } // namespace test
164 } // namespace ash 171 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_shell_delegate.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698