OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mandoline/ui/browser/browser_manager.h" | 5 #include "mandoline/ui/browser/browser_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "components/view_manager/public/cpp/view.h" | 8 #include "components/view_manager/public/cpp/view.h" |
9 #include "components/view_manager/public/cpp/view_observer.h" | 9 #include "components/view_manager/public/cpp/view_observer.h" |
10 #include "mandoline/ui/browser/browser.h" | 10 #include "mandoline/ui/browser/browser.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 mojo::ApplicationConnection* connection) { | 60 mojo::ApplicationConnection* connection) { |
61 connection->AddService<LaunchHandler>(this); | 61 connection->AddService<LaunchHandler>(this); |
62 return true; | 62 return true; |
63 } | 63 } |
64 | 64 |
65 void BrowserManager::BrowserClosed(Browser* browser) { | 65 void BrowserManager::BrowserClosed(Browser* browser) { |
66 scoped_ptr<Browser> browser_owner(browser); | 66 scoped_ptr<Browser> browser_owner(browser); |
67 DCHECK_GT(browsers_.count(browser), 0u); | 67 DCHECK_GT(browsers_.count(browser), 0u); |
68 browsers_.erase(browser); | 68 browsers_.erase(browser); |
69 if (browsers_.empty()) | 69 if (browsers_.empty()) |
70 app_->Terminate(); | 70 app_->Quit(); |
71 } | 71 } |
72 | 72 |
73 void BrowserManager::InitUIIfNecessary(Browser* browser, mojo::View* view) { | 73 void BrowserManager::InitUIIfNecessary(Browser* browser, mojo::View* view) { |
74 DCHECK_GT(view->viewport_metrics().device_pixel_ratio, 0); | 74 DCHECK_GT(view->viewport_metrics().device_pixel_ratio, 0); |
75 #if defined(USE_AURA) | 75 #if defined(USE_AURA) |
76 if (!aura_init_) | 76 if (!aura_init_) |
77 aura_init_.reset(new AuraInit(view, app_->shell())); | 77 aura_init_.reset(new AuraInit(view, app_->shell())); |
78 #endif | 78 #endif |
79 } | 79 } |
80 | 80 |
81 void BrowserManager::Create(mojo::ApplicationConnection* connection, | 81 void BrowserManager::Create(mojo::ApplicationConnection* connection, |
82 mojo::InterfaceRequest<LaunchHandler> request) { | 82 mojo::InterfaceRequest<LaunchHandler> request) { |
83 launch_handler_bindings_.AddBinding(this, request.Pass()); | 83 launch_handler_bindings_.AddBinding(this, request.Pass()); |
84 } | 84 } |
85 | 85 |
86 } // namespace mandoline | 86 } // namespace mandoline |
OLD | NEW |