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

Side by Side Diff: ash/common/wm_shell.cc

Issue 2199993002: Add generic PaletteDelegate code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@note-options
Patch Set: Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/wm_shell.h" 5 #include "ash/common/wm_shell.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_controller.h" 9 #include "ash/common/accelerators/accelerator_controller.h"
10 #include "ash/common/accelerators/ash_focus_manager_factory.h" 10 #include "ash/common/accelerators/ash_focus_manager_factory.h"
(...skipping 17 matching lines...) Expand all
28 #include "ash/common/wm/overview/window_selector_controller.h" 28 #include "ash/common/wm/overview/window_selector_controller.h"
29 #include "ash/common/wm/window_cycle_controller.h" 29 #include "ash/common/wm/window_cycle_controller.h"
30 #include "ash/common/wm_window.h" 30 #include "ash/common/wm_window.h"
31 #include "base/bind.h" 31 #include "base/bind.h"
32 #include "base/logging.h" 32 #include "base/logging.h"
33 #include "ui/app_list/presenter/app_list_presenter.h" 33 #include "ui/app_list/presenter/app_list_presenter.h"
34 #include "ui/display/display.h" 34 #include "ui/display/display.h"
35 #include "ui/views/focus/focus_manager_factory.h" 35 #include "ui/views/focus/focus_manager_factory.h"
36 36
37 #if defined(OS_CHROMEOS) 37 #if defined(OS_CHROMEOS)
38 #include "ash/common/palette_delegate.h"
38 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h " 39 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h "
39 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" 40 #include "ash/common/system/chromeos/keyboard_brightness_controller.h"
40 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" 41 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
41 #endif 42 #endif
42 43
43 namespace ash { 44 namespace ash {
44 45
45 // static 46 // static
46 WmShell* WmShell::instance_ = nullptr; 47 WmShell* WmShell::instance_ = nullptr;
47 48
48 // static 49 // static
49 void WmShell::Set(WmShell* instance) { 50 void WmShell::Set(WmShell* instance) {
50 instance_ = instance; 51 instance_ = instance;
51 } 52 }
52 53
53 // static 54 // static
54 WmShell* WmShell::Get() { 55 WmShell* WmShell::Get() {
55 return instance_; 56 return instance_;
56 } 57 }
57 58
58 void WmShell::Initialize() { 59 void WmShell::Initialize() {
59 // Some delegates access WmShell during their construction. Create them here 60 // Some delegates access WmShell during their construction. Create them here
60 // instead of the WmShell constructor. 61 // instead of the WmShell constructor.
61 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); 62 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate());
62 media_delegate_.reset(delegate_->CreateMediaDelegate()); 63 media_delegate_.reset(delegate_->CreateMediaDelegate());
64 palette_delegate_.reset(delegate_->CreatePaletteDelegate());
63 toast_manager_.reset(new ToastManager); 65 toast_manager_.reset(new ToastManager);
64 66
65 // Create the app list item in the shelf data model. 67 // Create the app list item in the shelf data model.
66 AppListShelfItemDelegate::CreateAppListItemAndDelegate(shelf_model_.get()); 68 AppListShelfItemDelegate::CreateAppListItemAndDelegate(shelf_model_.get());
67 69
68 // Install the custom factory early on so that views::FocusManagers for Tray, 70 // Install the custom factory early on so that views::FocusManagers for Tray,
69 // Shelf, and WallPaper could be created by the factory. 71 // Shelf, and WallPaper could be created by the factory.
70 views::FocusManagerFactory::Install(new AshFocusManagerFactory); 72 views::FocusManagerFactory::Install(new AshFocusManagerFactory);
71 73
72 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate()); 74 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate());
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 void WmShell::DeleteToastManager() { 257 void WmShell::DeleteToastManager() {
256 toast_manager_.reset(); 258 toast_manager_.reset();
257 } 259 }
258 260
259 void WmShell::SetAcceleratorController( 261 void WmShell::SetAcceleratorController(
260 std::unique_ptr<AcceleratorController> accelerator_controller) { 262 std::unique_ptr<AcceleratorController> accelerator_controller) {
261 accelerator_controller_ = std::move(accelerator_controller); 263 accelerator_controller_ = std::move(accelerator_controller);
262 } 264 }
263 265
264 } // namespace ash 266 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698