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

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

Issue 2576913002: Use mojo app list interfaces for mash and classic ash. (Closed)
Patch Set: Sync and rebase Created 3 years, 11 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/common/shell_delegate.h ('k') | ash/mus/BUILD.gn » ('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/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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "ash/common/wm_root_window_controller.h" 45 #include "ash/common/wm_root_window_controller.h"
46 #include "ash/common/wm_window.h" 46 #include "ash/common/wm_window.h"
47 #include "ash/public/cpp/shell_window_ids.h" 47 #include "ash/public/cpp/shell_window_ids.h"
48 #include "base/bind.h" 48 #include "base/bind.h"
49 #include "base/logging.h" 49 #include "base/logging.h"
50 #include "base/memory/ptr_util.h" 50 #include "base/memory/ptr_util.h"
51 #include "services/preferences/public/cpp/pref_observer_store.h" 51 #include "services/preferences/public/cpp/pref_observer_store.h"
52 #include "services/preferences/public/interfaces/preferences.mojom.h" 52 #include "services/preferences/public/interfaces/preferences.mojom.h"
53 #include "services/service_manager/public/cpp/connector.h" 53 #include "services/service_manager/public/cpp/connector.h"
54 #include "ui/app_list/presenter/app_list.h" 54 #include "ui/app_list/presenter/app_list.h"
55 #include "ui/app_list/presenter/app_list_presenter.h"
56 #include "ui/display/display.h" 55 #include "ui/display/display.h"
57 #include "ui/views/focus/focus_manager_factory.h" 56 #include "ui/views/focus/focus_manager_factory.h"
58 57
59 #if defined(OS_CHROMEOS) 58 #if defined(OS_CHROMEOS)
60 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h " 59 #include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h "
61 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" 60 #include "ash/common/system/chromeos/keyboard_brightness_controller.h"
62 #include "ash/common/system/chromeos/network/vpn_list.h" 61 #include "ash/common/system/chromeos/network/vpn_list.h"
63 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" 62 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
64 #endif 63 #endif
65 64
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 336 }
338 for (WmWindow* root_window : root_windows) { 337 for (WmWindow* root_window : root_windows) {
339 root_window->GetRootWindowController() 338 root_window->GetRootWindowController()
340 ->GetSystemModalLayoutManager(removed) 339 ->GetSystemModalLayoutManager(removed)
341 ->DestroyModalBackground(); 340 ->DestroyModalBackground();
342 } 341 }
343 } 342 }
344 343
345 void WmShell::ShowAppList() { 344 void WmShell::ShowAppList() {
346 // Show the app list on the default display for new windows. 345 // Show the app list on the default display for new windows.
347 int64_t display_id = 346 app_list_->Show(GetRootWindowForNewWindows()->GetDisplayNearestWindow().id());
348 GetRootWindowForNewWindows()->GetDisplayNearestWindow().id();
349 delegate_->GetAppListPresenter()->Show(display_id);
350 } 347 }
351 348
352 void WmShell::DismissAppList() { 349 void WmShell::DismissAppList() {
353 delegate_->GetAppListPresenter()->Dismiss(); 350 app_list_->Dismiss();
354 } 351 }
355 352
356 void WmShell::ToggleAppList() { 353 void WmShell::ToggleAppList() {
357 // Show the app list on the default display for new windows. 354 // Toggle the app list on the default display for new windows.
358 int64_t display_id = 355 app_list_->ToggleAppList(
359 GetRootWindowForNewWindows()->GetDisplayNearestWindow().id(); 356 GetRootWindowForNewWindows()->GetDisplayNearestWindow().id());
360 delegate_->GetAppListPresenter()->ToggleAppList(display_id);
361 } 357 }
362 358
363 bool WmShell::IsApplistVisible() const { 359 bool WmShell::IsApplistVisible() const {
364 return delegate_->GetAppListPresenter()->IsVisible(); 360 return app_list_->IsVisible();
365 } 361 }
366 362
367 bool WmShell::GetAppListTargetVisibility() const { 363 bool WmShell::GetAppListTargetVisibility() const {
368 return delegate_->GetAppListPresenter()->GetTargetVisibility(); 364 return app_list_->GetTargetVisibility();
369 } 365 }
370 366
371 void WmShell::SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui) { 367 void WmShell::SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui) {
372 keyboard_ui_ = std::move(keyboard_ui); 368 keyboard_ui_ = std::move(keyboard_ui);
373 } 369 }
374 370
375 void WmShell::SetSystemTrayDelegate( 371 void WmShell::SetSystemTrayDelegate(
376 std::unique_ptr<SystemTrayDelegate> delegate) { 372 std::unique_ptr<SystemTrayDelegate> delegate) {
377 DCHECK(delegate); 373 DCHECK(delegate);
378 system_tray_delegate_ = std::move(delegate); 374 system_tray_delegate_ = std::move(delegate);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 424 }
429 425
430 void WmShell::SessionStateChanged(session_manager::SessionState state) { 426 void WmShell::SessionStateChanged(session_manager::SessionState state) {
431 // Create the shelf when a session becomes active. It's safe to do this 427 // Create the shelf when a session becomes active. It's safe to do this
432 // multiple times (e.g. initial login vs. multiprofile add session). 428 // multiple times (e.g. initial login vs. multiprofile add session).
433 if (state == session_manager::SessionState::ACTIVE) 429 if (state == session_manager::SessionState::ACTIVE)
434 CreateShelf(); 430 CreateShelf();
435 } 431 }
436 432
437 } // namespace ash 433 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shell_delegate.h ('k') | ash/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698