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

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

Issue 1425263003: Use TimeTicks as much as possible in startup_metric_utils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ifdef thread priority dance out on Mac per lack of support in base Created 5 years, 1 month 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
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/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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698