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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 22594007: Implement CurrentProcessInfo::CreationTime() for Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add a ScopedAllowIO Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "chrome/browser/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 1204
1205 bool Browser::IsMouseLocked() const { 1205 bool Browser::IsMouseLocked() const {
1206 return fullscreen_controller_->IsMouseLocked(); 1206 return fullscreen_controller_->IsMouseLocked();
1207 } 1207 }
1208 1208
1209 void Browser::OnWindowDidShow() { 1209 void Browser::OnWindowDidShow() {
1210 if (window_has_shown_) 1210 if (window_has_shown_)
1211 return; 1211 return;
1212 window_has_shown_ = true; 1212 window_has_shown_ = true;
1213 1213
1214 // CurrentProcessInfo::CreationTime() is currently only implemented on Mac and
1215 // Windows.
1216 #if defined(OS_MACOSX) || defined(OS_WIN)
1217 // Measure the latency from startup till the first browser window becomes 1214 // Measure the latency from startup till the first browser window becomes
1218 // visible. 1215 // visible.
1219 static bool is_first_browser_window = true; 1216 static bool is_first_browser_window = true;
1220 if (is_first_browser_window && 1217 if (is_first_browser_window &&
1221 !startup_metric_utils::WasNonBrowserUIDisplayed()) { 1218 !startup_metric_utils::WasNonBrowserUIDisplayed()) {
1222 is_first_browser_window = false; 1219 is_first_browser_window = false;
1223 const base::Time* process_creation_time = 1220 const base::Time* process_creation_time =
1224 base::CurrentProcessInfo::CreationTime(); 1221 base::CurrentProcessInfo::CreationTime();
1225 1222
1226 if (process_creation_time) { 1223 if (process_creation_time) {
1227 UMA_HISTOGRAM_LONG_TIMES( 1224 UMA_HISTOGRAM_LONG_TIMES(
1228 "Startup.BrowserWindowDisplay", 1225 "Startup.BrowserWindowDisplay",
1229 base::Time::Now() - *process_creation_time); 1226 base::Time::Now() - *process_creation_time);
1230 } 1227 }
1231 } 1228 }
1232 #endif // defined(OS_MACOSX) || defined(OS_WIN)
1233 1229
1234 // Nothing to do for non-tabbed windows. 1230 // Nothing to do for non-tabbed windows.
1235 if (!is_type_tabbed()) 1231 if (!is_type_tabbed())
1236 return; 1232 return;
1237 1233
1238 // Show any pending global error bubble. 1234 // Show any pending global error bubble.
1239 GlobalErrorService* service = 1235 GlobalErrorService* service =
1240 GlobalErrorServiceFactory::GetForProfile(profile()); 1236 GlobalErrorServiceFactory::GetForProfile(profile());
1241 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); 1237 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView();
1242 if (error) 1238 if (error)
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 if (contents && !allow_js_access) { 2244 if (contents && !allow_js_access) {
2249 contents->web_contents()->GetController().LoadURL( 2245 contents->web_contents()->GetController().LoadURL(
2250 target_url, 2246 target_url,
2251 content::Referrer(), 2247 content::Referrer(),
2252 content::PAGE_TRANSITION_LINK, 2248 content::PAGE_TRANSITION_LINK,
2253 std::string()); // No extra headers. 2249 std::string()); // No extra headers.
2254 } 2250 }
2255 2251
2256 return contents != NULL; 2252 return contents != NULL;
2257 } 2253 }
OLDNEW
« base/process/process_info_linux.cc ('K') | « chrome/browser/ui/app_list/app_list_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698