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

Side by Side Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2150023002: Add ShellDelegate, MediaDelegate and KeyboardUI stubs to mus ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix deps Created 4 years, 5 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/mus/bridge/wm_shell_mus.h" 5 #include "ash/mus/bridge/wm_shell_mus.h"
6 6
7 #include <utility>
8
7 #include "ash/common/default_accessibility_delegate.h" 9 #include "ash/common/default_accessibility_delegate.h"
8 #include "ash/common/display/display_info.h" 10 #include "ash/common/display/display_info.h"
11 #include "ash/common/keyboard/keyboard_ui.h"
9 #include "ash/common/session/session_state_delegate.h" 12 #include "ash/common/session/session_state_delegate.h"
13 #include "ash/common/shell_delegate.h"
10 #include "ash/common/shell_observer.h" 14 #include "ash/common/shell_observer.h"
11 #include "ash/common/shell_window_ids.h" 15 #include "ash/common/shell_window_ids.h"
12 #include "ash/common/system/tray/default_system_tray_delegate.h" 16 #include "ash/common/system/tray/default_system_tray_delegate.h"
13 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" 17 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h"
14 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h" 18 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h"
15 #include "ash/common/wm/mru_window_tracker.h" 19 #include "ash/common/wm/mru_window_tracker.h"
16 #include "ash/common/wm/window_resizer.h" 20 #include "ash/common/wm/window_resizer.h"
17 #include "ash/common/wm_activation_observer.h" 21 #include "ash/common/wm_activation_observer.h"
18 #include "ash/mus/bridge/wm_root_window_controller_mus.h" 22 #include "ash/mus/bridge/wm_root_window_controller_mus.h"
19 #include "ash/mus/bridge/wm_window_mus.h" 23 #include "ash/mus/bridge/wm_window_mus.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 116 }
113 117
114 ui::mojom::AccessibilityManagerPtr accessibility_manager_ptr_; 118 ui::mojom::AccessibilityManagerPtr accessibility_manager_ptr_;
115 shell::Connector* connector_; 119 shell::Connector* connector_;
116 120
117 DISALLOW_COPY_AND_ASSIGN(AccessibilityDelegateMus); 121 DISALLOW_COPY_AND_ASSIGN(AccessibilityDelegateMus);
118 }; 122 };
119 123
120 } // namespace 124 } // namespace
121 125
122 WmShellMus::WmShellMus(ShellDelegate* delegate, 126 WmShellMus::WmShellMus(std::unique_ptr<ShellDelegate> shell_delegate,
123 ::ui::WindowTreeClient* client, 127 ::ui::WindowTreeClient* client,
124 shell::Connector* connector) 128 shell::Connector* connector)
125 : WmShell(delegate), 129 : WmShell(std::move(shell_delegate)),
126 client_(client), 130 client_(client),
127 connector_(connector), 131 connector_(connector),
128 session_state_delegate_(new SessionStateDelegateStub) { 132 session_state_delegate_(new SessionStateDelegateStub) {
129 client_->AddObserver(this); 133 client_->AddObserver(this);
130 WmShell::Set(this); 134 WmShell::Set(this);
131 135
132 CreateMaximizeModeController(); 136 CreateMaximizeModeController();
133 137
134 CreateMruWindowTracker(); 138 CreateMruWindowTracker();
135 139
136 accessibility_delegate_.reset(new AccessibilityDelegateMus(connector_)); 140 accessibility_delegate_.reset(new AccessibilityDelegateMus(connector_));
141 SetMediaDelegate(base::WrapUnique(delegate()->CreateMediaDelegate()));
msw 2016/07/14 19:50:05 q: Would it make sense to move the corresponding a
James Cook 2016/07/14 20:54:44 I think the right thing to do here is to have the
msw 2016/07/14 20:58:04 Acknowledged.
137 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); 142 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate));
143
144 // TODO(jamescook): Port ash::sysui::KeyboardUIMus and use it here.
145 SetKeyboardUI(KeyboardUI::Create());
138 } 146 }
139 147
140 WmShellMus::~WmShellMus() { 148 WmShellMus::~WmShellMus() {
141 // This order mirrors that of Shell. 149 // This order mirrors that of Shell.
142 150
143 // Destroy maximize mode controller early on since it has some observers which 151 // Destroy maximize mode controller early on since it has some observers which
144 // need to be removed. 152 // need to be removed.
145 DeleteMaximizeModeController(); 153 DeleteMaximizeModeController();
146 DeleteSystemTrayDelegate(); 154 DeleteSystemTrayDelegate();
147 DeleteWindowSelectorController(); 155 DeleteWindowSelectorController();
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 OnWindowActivated(gained_active, lost_active)); 368 OnWindowActivated(gained_active, lost_active));
361 } 369 }
362 370
363 void WmShellMus::OnDidDestroyClient(::ui::WindowTreeClient* client) { 371 void WmShellMus::OnDidDestroyClient(::ui::WindowTreeClient* client) {
364 DCHECK_EQ(client, client_); 372 DCHECK_EQ(client, client_);
365 RemoveClientObserver(); 373 RemoveClientObserver();
366 } 374 }
367 375
368 } // namespace mus 376 } // namespace mus
369 } // namespace ash 377 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698