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/desktop_ui/browser_manager.h" | 5 #include "mandoline/ui/desktop_ui/browser_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "components/mus/public/cpp/window.h" | 8 #include "components/mus/public/cpp/window.h" |
9 #include "components/mus/public/cpp/window_observer.h" | 9 #include "components/mus/public/cpp/window_observer.h" |
10 #include "mandoline/ui/desktop_ui/browser_window.h" | 10 #include "mandoline/ui/desktop_ui/browser_window.h" |
11 | 11 |
12 namespace mandoline { | 12 namespace mandoline { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const char kGoogleURL[] = "http://www.google.com"; | 16 const char kGoogleURL[] = "http://www.google.com"; |
17 | 17 |
18 } // namespace | 18 } // namespace |
19 | 19 |
20 BrowserManager::BrowserManager() | 20 BrowserManager::BrowserManager() |
21 : app_(nullptr), startup_time_(base::Time::Now()) {} | 21 : app_(nullptr), startup_ticks_(base::TimeTicks::Now()) {} |
22 | 22 |
23 BrowserManager::~BrowserManager() { | 23 BrowserManager::~BrowserManager() { |
24 while (!browsers_.empty()) | 24 while (!browsers_.empty()) |
25 (*browsers_.begin())->Close(); | 25 (*browsers_.begin())->Close(); |
26 DCHECK(browsers_.empty()); | 26 DCHECK(browsers_.empty()); |
27 } | 27 } |
28 | 28 |
29 BrowserWindow* BrowserManager::CreateBrowser(const GURL& default_url) { | 29 BrowserWindow* BrowserManager::CreateBrowser(const GURL& default_url) { |
30 BrowserWindow* browser = new BrowserWindow(app_, host_factory_.get(), this); | 30 BrowserWindow* browser = new BrowserWindow(app_, host_factory_.get(), this); |
31 browsers_.insert(browser); | 31 browsers_.insert(browser); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 connection->AddService<LaunchHandler>(this); | 72 connection->AddService<LaunchHandler>(this); |
73 return true; | 73 return true; |
74 } | 74 } |
75 | 75 |
76 void BrowserManager::Create(mojo::ApplicationConnection* connection, | 76 void BrowserManager::Create(mojo::ApplicationConnection* connection, |
77 mojo::InterfaceRequest<LaunchHandler> request) { | 77 mojo::InterfaceRequest<LaunchHandler> request) { |
78 launch_handler_bindings_.AddBinding(this, request.Pass()); | 78 launch_handler_bindings_.AddBinding(this, request.Pass()); |
79 } | 79 } |
80 | 80 |
81 } // namespace mandoline | 81 } // namespace mandoline |
OLD | NEW |