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

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

Issue 2617883002: Add a new BindInterface() method to Connector. (Closed)
Patch Set: . 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 | « content/renderer/render_thread_impl.cc ('k') | mash/catalog_viewer/catalog_viewer.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 "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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 void Browser::RemoveWindow(views::Widget* window) { 867 void Browser::RemoveWindow(views::Widget* window) {
868 auto it = std::find(windows_.begin(), windows_.end(), window); 868 auto it = std::find(windows_.begin(), windows_.end(), window);
869 DCHECK(it != windows_.end()); 869 DCHECK(it != windows_.end());
870 windows_.erase(it); 870 windows_.erase(it);
871 if (windows_.empty()) 871 if (windows_.empty())
872 base::MessageLoop::current()->QuitWhenIdle(); 872 base::MessageLoop::current()->QuitWhenIdle();
873 } 873 }
874 874
875 std::unique_ptr<navigation::View> Browser::CreateView() { 875 std::unique_ptr<navigation::View> Browser::CreateView() {
876 navigation::mojom::ViewFactoryPtr factory; 876 navigation::mojom::ViewFactoryPtr factory;
877 context()->connector()->ConnectToInterface( 877 context()->connector()->BindInterface(content::mojom::kBrowserServiceName,
878 content::mojom::kBrowserServiceName, &factory); 878 &factory);
879 return base::MakeUnique<navigation::View>(std::move(factory)); 879 return base::MakeUnique<navigation::View>(std::move(factory));
880 } 880 }
881 881
882 void Browser::OnStart() { 882 void Browser::OnStart() {
883 tracing_.Initialize(context()->connector(), context()->identity().name()); 883 tracing_.Initialize(context()->connector(), context()->identity().name());
884 884
885 aura_init_ = base::MakeUnique<views::AuraInit>( 885 aura_init_ = base::MakeUnique<views::AuraInit>(
886 context()->connector(), context()->identity(), "views_mus_resources.pak", 886 context()->connector(), context()->identity(), "views_mus_resources.pak",
887 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); 887 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS);
888 } 888 }
(...skipping 20 matching lines...) Expand all
909 AddWindow(window); 909 AddWindow(window);
910 } 910 }
911 911
912 void Browser::Create(const service_manager::Identity& remote_identity, 912 void Browser::Create(const service_manager::Identity& remote_identity,
913 mojom::LaunchableRequest request) { 913 mojom::LaunchableRequest request) {
914 bindings_.AddBinding(this, std::move(request)); 914 bindings_.AddBinding(this, std::move(request));
915 } 915 }
916 916
917 } // namespace browser 917 } // namespace browser
918 } // namespace mash 918 } // namespace mash
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | mash/catalog_viewer/catalog_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698