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

Side by Side Diff: mash/browser/browser.cc

Issue 2487573002: Service Manager: Remove ServiceContext* arg from Service::OnStart() (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « mash/browser/browser.h ('k') | mash/catalog_viewer/catalog_viewer.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 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 "mash/browser/browser.h" 5 #include "mash/browser/browser.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 void Browser::RemoveWindow(views::Widget* window) { 858 void Browser::RemoveWindow(views::Widget* window) {
859 auto it = std::find(windows_.begin(), windows_.end(), window); 859 auto it = std::find(windows_.begin(), windows_.end(), window);
860 DCHECK(it != windows_.end()); 860 DCHECK(it != windows_.end());
861 windows_.erase(it); 861 windows_.erase(it);
862 if (windows_.empty()) 862 if (windows_.empty())
863 base::MessageLoop::current()->QuitWhenIdle(); 863 base::MessageLoop::current()->QuitWhenIdle();
864 } 864 }
865 865
866 std::unique_ptr<navigation::View> Browser::CreateView() { 866 std::unique_ptr<navigation::View> Browser::CreateView() {
867 navigation::mojom::ViewFactoryPtr factory; 867 navigation::mojom::ViewFactoryPtr factory;
868 context_->connector()->ConnectToInterface("exe:navigation", &factory); 868 context()->connector()->ConnectToInterface("exe:navigation", &factory);
869 return base::MakeUnique<navigation::View>(std::move(factory)); 869 return base::MakeUnique<navigation::View>(std::move(factory));
870 } 870 }
871 871
872 void Browser::OnStart(service_manager::ServiceContext* context) { 872 void Browser::OnStart() {
873 context_ = context; 873 tracing_.Initialize(context()->connector(), context()->identity().name());
874 tracing_.Initialize(context->connector(), context->identity().name());
875 874
876 aura_init_ = base::MakeUnique<views::AuraInit>( 875 aura_init_ = base::MakeUnique<views::AuraInit>(
877 context->connector(), context->identity(), "views_mus_resources.pak"); 876 context()->connector(), context()->identity(), "views_mus_resources.pak");
878 window_manager_connection_ = views::WindowManagerConnection::Create( 877 window_manager_connection_ = views::WindowManagerConnection::Create(
879 context->connector(), context->identity()); 878 context()->connector(), context()->identity());
880 } 879 }
881 880
882 bool Browser::OnConnect(const service_manager::ServiceInfo& remote_info, 881 bool Browser::OnConnect(const service_manager::ServiceInfo& remote_info,
883 service_manager::InterfaceRegistry* registry) { 882 service_manager::InterfaceRegistry* registry) {
884 registry->AddInterface<mojom::Launchable>(this); 883 registry->AddInterface<mojom::Launchable>(this);
885 return true; 884 return true;
886 } 885 }
887 886
888 void Browser::Launch(uint32_t what, mojom::LaunchMode how) { 887 void Browser::Launch(uint32_t what, mojom::LaunchMode how) {
889 bool reuse = 888 bool reuse =
(...skipping 11 matching lines...) Expand all
901 AddWindow(window); 900 AddWindow(window);
902 } 901 }
903 902
904 void Browser::Create(const service_manager::Identity& remote_identity, 903 void Browser::Create(const service_manager::Identity& remote_identity,
905 mojom::LaunchableRequest request) { 904 mojom::LaunchableRequest request) {
906 bindings_.AddBinding(this, std::move(request)); 905 bindings_.AddBinding(this, std::move(request));
907 } 906 }
908 907
909 } // namespace browser 908 } // namespace browser
910 } // namespace mash 909 } // namespace mash
OLDNEW
« no previous file with comments | « mash/browser/browser.h ('k') | mash/catalog_viewer/catalog_viewer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698