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

Side by Side Diff: ash/shell.cc

Issue 2839933005: mash: Merge ChromeLauncherController and *Impl subclass. (Closed)
Patch Set: Address comments. Created 3 years, 8 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 | « no previous file | ash/shell_delegate.h » ('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 (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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 FirstRunHelper* Shell::CreateFirstRunHelper() { 402 FirstRunHelper* Shell::CreateFirstRunHelper() {
403 return new FirstRunHelperImpl; 403 return new FirstRunHelperImpl;
404 } 404 }
405 405
406 void Shell::CreateShelfView() { 406 void Shell::CreateShelfView() {
407 // Must occur after SessionController creation and user login. 407 // Must occur after SessionController creation and user login.
408 DCHECK(session_controller()); 408 DCHECK(session_controller());
409 DCHECK_GT(session_controller()->NumberOfLoggedInUsers(), 0); 409 DCHECK_GT(session_controller()->NumberOfLoggedInUsers(), 0);
410 410
411 // Notify the ShellDelegate that the shelf is being initialized. 411 // Notify the ShellDelegate that the shelf is being initialized.
412 // TODO(msw): Refine ChromeLauncherControllerImpl lifetime management. 412 // TODO(msw): Refine ChromeLauncherController lifetime management.
413 shell_delegate_->ShelfInit(); 413 shell_delegate_->ShelfInit();
414 414
415 if (!shelf_window_watcher_) 415 if (!shelf_window_watcher_)
416 shelf_window_watcher_ = base::MakeUnique<ShelfWindowWatcher>(shelf_model()); 416 shelf_window_watcher_ = base::MakeUnique<ShelfWindowWatcher>(shelf_model());
417 for (WmWindow* root_window : shell_port_->GetAllRootWindows()) 417 for (WmWindow* root_window : shell_port_->GetAllRootWindows())
418 root_window->GetRootWindowController()->CreateShelfView(); 418 root_window->GetRootWindowController()->CreateShelfView();
419 } 419 }
420 420
421 void Shell::SetLargeCursorSizeInDip(int large_cursor_size_in_dip) { 421 void Shell::SetLargeCursorSizeInDip(int large_cursor_size_in_dip) {
422 window_tree_host_manager_->cursor_window_controller() 422 window_tree_host_manager_->cursor_window_controller()
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 views::FocusManagerFactory::Install(nullptr); 722 views::FocusManagerFactory::Install(nullptr);
723 723
724 // ShelfWindowWatcher has window observers and a pointer to the shelf model. 724 // ShelfWindowWatcher has window observers and a pointer to the shelf model.
725 shelf_window_watcher_.reset(); 725 shelf_window_watcher_.reset();
726 726
727 // ShelfItemDelegate subclasses it owns have complex cleanup to run (e.g. ARC 727 // ShelfItemDelegate subclasses it owns have complex cleanup to run (e.g. ARC
728 // shelf items in Chrome) so explicitly shutdown early. 728 // shelf items in Chrome) so explicitly shutdown early.
729 shelf_model()->DestroyItemDelegates(); 729 shelf_model()->DestroyItemDelegates();
730 730
731 // Notify the ShellDelegate that the shelf is shutting down. 731 // Notify the ShellDelegate that the shelf is shutting down.
732 // TODO(msw): Refine ChromeLauncherControllerImpl lifetime management. 732 // TODO(msw): Refine ChromeLauncherController lifetime management.
733 shell_delegate_->ShelfShutdown(); 733 shell_delegate_->ShelfShutdown();
734 734
735 // Removes itself as an observer of |pref_service_|. 735 // Removes itself as an observer of |pref_service_|.
736 shelf_controller_.reset(); 736 shelf_controller_.reset();
737 737
738 shell_port_->Shutdown(); 738 shell_port_->Shutdown();
739 739
740 // Depends on |focus_controller_|, so must be destroyed before. 740 // Depends on |focus_controller_|, so must be destroyed before.
741 window_tree_host_manager_.reset(); 741 window_tree_host_manager_.reset();
742 focus_controller_->RemoveObserver(this); 742 focus_controller_->RemoveObserver(this);
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 void Shell::OnPrefServiceInitialized( 1232 void Shell::OnPrefServiceInitialized(
1233 std::unique_ptr<::PrefService> pref_service) { 1233 std::unique_ptr<::PrefService> pref_service) {
1234 if (!instance_) 1234 if (!instance_)
1235 return; 1235 return;
1236 // |pref_service_| is null if can't connect to Chrome (as happens when 1236 // |pref_service_| is null if can't connect to Chrome (as happens when
1237 // running mash outside of chrome --mash and chrome isn't built). 1237 // running mash outside of chrome --mash and chrome isn't built).
1238 pref_service_ = std::move(pref_service); 1238 pref_service_ = std::move(pref_service);
1239 } 1239 }
1240 1240
1241 } // namespace ash 1241 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698