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

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

Issue 2323063003: mash: Port sysui's WallpaperDelegateMus to mojo:ash. (Closed)
Patch Set: Cleanup. Created 4 years, 3 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/mus/bridge/wm_shell_mus.h ('k') | ash/mus/context_menu_mus.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 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> 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/keyboard/keyboard_ui.h" 10 #include "ash/common/keyboard/keyboard_ui.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 CreateMaximizeModeController(); 134 CreateMaximizeModeController();
135 135
136 CreateMruWindowTracker(); 136 CreateMruWindowTracker();
137 137
138 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate)); 138 SetSystemTrayDelegate(base::WrapUnique(new DefaultSystemTrayDelegate));
139 139
140 // TODO(jamescook): Port ash::sysui::KeyboardUIMus and use it here. 140 // TODO(jamescook): Port ash::sysui::KeyboardUIMus and use it here.
141 SetKeyboardUI(KeyboardUI::Create()); 141 SetKeyboardUI(KeyboardUI::Create());
142 142
143 // TODO(msw): Port WallpaperDelegateMus and support this (crbug.com/629605): 143 wallpaper_delegate()->InitializeWallpaper();
144 // wallpaper_delegate()->InitializeWallpaper();
145 } 144 }
146 145
147 WmShellMus::~WmShellMus() { 146 WmShellMus::~WmShellMus() {
148 // This order mirrors that of Shell. 147 // This order mirrors that of Shell.
149 148
150 // Destroy maximize mode controller early on since it has some observers which 149 // Destroy maximize mode controller early on since it has some observers which
151 // need to be removed. 150 // need to be removed.
152 DeleteMaximizeModeController(); 151 DeleteMaximizeModeController();
153 DeleteToastManager(); 152 DeleteToastManager();
154 DeleteSystemTrayDelegate(); 153 DeleteSystemTrayDelegate();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 223 }
225 224
226 WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) { 225 WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) {
227 return GetRootWindowControllerWithDisplayId(display_id)->GetWindow(); 226 return GetRootWindowControllerWithDisplayId(display_id)->GetWindow();
228 } 227 }
229 228
230 const display::ManagedDisplayInfo& WmShellMus::GetDisplayInfo( 229 const display::ManagedDisplayInfo& WmShellMus::GetDisplayInfo(
231 int64_t display_id) const { 230 int64_t display_id) const {
232 // TODO(mash): implement http://crbug.com/622480. 231 // TODO(mash): implement http://crbug.com/622480.
233 NOTIMPLEMENTED(); 232 NOTIMPLEMENTED();
233
234 // Return a stub ManagedDisplayInfo object created from a Display object.
msw 2016/09/09 19:10:04 Let me know if there's a better way to do this at
kylechar 2016/09/09 20:12:35 Hmm, this is probably the wrong thing to do here (
msw 2016/09/09 21:13:08 I uploaded an alternative workaround patch to appe
235 auto info = display_info_map_.find(display_id);
236 if (info != display_info_map_.end())
237 return info->second;
238 for (const display::Display& display :
239 display::Screen::GetScreen()->GetAllDisplays()) {
240 if (display.id() == display_id) {
241 display::ManagedDisplayInfo info(display.id(), "MusDisplay", false);
242 info.SetBounds(display.bounds());
243 info.set_device_scale_factor(display.device_scale_factor());
244 info.SetRotation(display.rotation(),
245 display::Display::ROTATION_SOURCE_UNKNOWN);
246 info.set_touch_support(display.touch_support());
247 info.set_maximum_cursor_size(display.maximum_cursor_size());
248 display_info_map_[display_id] = info;
249 return display_info_map_[display_id];
250 }
251 }
252
234 static display::ManagedDisplayInfo fake_info; 253 static display::ManagedDisplayInfo fake_info;
235 return fake_info; 254 return fake_info;
236 } 255 }
237 256
238 bool WmShellMus::IsActiveDisplayId(int64_t display_id) const { 257 bool WmShellMus::IsActiveDisplayId(int64_t display_id) const {
239 // TODO(mash): implement http://crbug.com/622480. 258 // TODO(mash): implement http://crbug.com/622480.
240 NOTIMPLEMENTED(); 259 NOTIMPLEMENTED();
241 return true; 260 return true;
242 } 261 }
243 262
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 OnWindowActivated(gained_active, lost_active)); 456 OnWindowActivated(gained_active, lost_active));
438 } 457 }
439 458
440 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) { 459 void WmShellMus::OnDidDestroyClient(ui::WindowTreeClient* client) {
441 DCHECK_EQ(window_tree_client(), client); 460 DCHECK_EQ(window_tree_client(), client);
442 client->RemoveObserver(this); 461 client->RemoveObserver(this);
443 } 462 }
444 463
445 } // namespace mus 464 } // namespace mus
446 } // namespace ash 465 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.h ('k') | ash/mus/context_menu_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698