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

Side by Side Diff: mandoline/ui/browser/browser_manager.cc

Issue 1266643003: ApplicationImpl cleanup, part 1: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 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 | « device/devices_app/devices_app.cc ('k') | mojo/application/public/cpp/app_lifetime_helper.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 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
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
OLDNEW
« no previous file with comments | « device/devices_app/devices_app.cc ('k') | mojo/application/public/cpp/app_lifetime_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698