| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |