OLD | NEW |
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/gpu_support_stub.h" | 9 #include "ash/gpu_support_stub.h" |
10 #include "ash/palette_delegate.h" | 10 #include "ash/palette_delegate.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 namespace test { | 32 namespace test { |
33 | 33 |
34 // A ShellObserver that sets the shelf alignment and auto hide behavior when the | 34 // A ShellObserver that sets the shelf alignment and auto hide behavior when the |
35 // shelf is created, to simulate ChromeLauncherController's behavior. | 35 // shelf is created, to simulate ChromeLauncherController's behavior. |
36 class ShelfInitializer : public ShellObserver { | 36 class ShelfInitializer : public ShellObserver { |
37 public: | 37 public: |
38 ShelfInitializer() { Shell::Get()->AddShellObserver(this); } | 38 ShelfInitializer() { Shell::Get()->AddShellObserver(this); } |
39 ~ShelfInitializer() override { Shell::Get()->RemoveShellObserver(this); } | 39 ~ShelfInitializer() override { Shell::Get()->RemoveShellObserver(this); } |
40 | 40 |
41 // ShellObserver: | 41 // ShellObserver: |
42 void OnShelfCreatedForRootWindow(WmWindow* root_window) override { | 42 void OnShelfCreatedForRootWindow(aura::Window* root_window) override { |
43 Shelf* shelf = root_window->GetRootWindowController()->GetShelf(); | 43 Shelf* shelf = RootWindowController::ForWindow(root_window)->GetShelf(); |
44 // Do not override the custom initialization performed by some unit tests. | 44 // Do not override the custom initialization performed by some unit tests. |
45 if (shelf->alignment() == SHELF_ALIGNMENT_BOTTOM_LOCKED && | 45 if (shelf->alignment() == SHELF_ALIGNMENT_BOTTOM_LOCKED && |
46 shelf->auto_hide_behavior() == SHELF_AUTO_HIDE_ALWAYS_HIDDEN) { | 46 shelf->auto_hide_behavior() == SHELF_AUTO_HIDE_ALWAYS_HIDDEN) { |
47 shelf->SetAlignment(SHELF_ALIGNMENT_BOTTOM); | 47 shelf->SetAlignment(SHELF_ALIGNMENT_BOTTOM); |
48 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 48 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
49 shelf->UpdateVisibilityState(); | 49 shelf->UpdateVisibilityState(); |
50 } | 50 } |
51 } | 51 } |
52 | 52 |
53 private: | 53 private: |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 void TestShellDelegate::SetTouchscreenEnabledInPrefs(bool enabled, | 160 void TestShellDelegate::SetTouchscreenEnabledInPrefs(bool enabled, |
161 bool use_local_state) { | 161 bool use_local_state) { |
162 if (use_local_state) | 162 if (use_local_state) |
163 touchscreen_enabled_in_local_pref_ = enabled; | 163 touchscreen_enabled_in_local_pref_ = enabled; |
164 } | 164 } |
165 | 165 |
166 void TestShellDelegate::UpdateTouchscreenStatusFromPrefs() {} | 166 void TestShellDelegate::UpdateTouchscreenStatusFromPrefs() {} |
167 | 167 |
168 } // namespace test | 168 } // namespace test |
169 } // namespace ash | 169 } // namespace ash |
OLD | NEW |