OLD | NEW |
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 Loading... |
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 | 1214 // CurrentProcessInfo::CreationTime() is missing on some platforms. |
1215 // Windows. | 1215 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) |
1216 #if defined(OS_MACOSX) || defined(OS_WIN) | |
1217 // Measure the latency from startup till the first browser window becomes | 1216 // Measure the latency from startup till the first browser window becomes |
1218 // visible. | 1217 // visible. |
1219 static bool is_first_browser_window = true; | 1218 static bool is_first_browser_window = true; |
1220 if (is_first_browser_window && | 1219 if (is_first_browser_window && |
1221 !startup_metric_utils::WasNonBrowserUIDisplayed()) { | 1220 !startup_metric_utils::WasNonBrowserUIDisplayed()) { |
1222 is_first_browser_window = false; | 1221 is_first_browser_window = false; |
1223 const base::Time* process_creation_time = | 1222 const base::Time process_creation_time = |
1224 base::CurrentProcessInfo::CreationTime(); | 1223 base::CurrentProcessInfo::CreationTime(); |
1225 | 1224 |
1226 if (process_creation_time) { | 1225 if (!process_creation_time.is_null()) { |
1227 UMA_HISTOGRAM_LONG_TIMES( | 1226 UMA_HISTOGRAM_LONG_TIMES( |
1228 "Startup.BrowserWindowDisplay", | 1227 "Startup.BrowserWindowDisplay", |
1229 base::Time::Now() - *process_creation_time); | 1228 base::Time::Now() - process_creation_time); |
1230 } | 1229 } |
1231 } | 1230 } |
1232 #endif // defined(OS_MACOSX) || defined(OS_WIN) | 1231 #endif // defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) |
1233 | 1232 |
1234 // Nothing to do for non-tabbed windows. | 1233 // Nothing to do for non-tabbed windows. |
1235 if (!is_type_tabbed()) | 1234 if (!is_type_tabbed()) |
1236 return; | 1235 return; |
1237 | 1236 |
1238 // Show any pending global error bubble. | 1237 // Show any pending global error bubble. |
1239 GlobalErrorService* service = | 1238 GlobalErrorService* service = |
1240 GlobalErrorServiceFactory::GetForProfile(profile()); | 1239 GlobalErrorServiceFactory::GetForProfile(profile()); |
1241 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 1240 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
1242 if (error) | 1241 if (error) |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2247 if (contents && !allow_js_access) { | 2246 if (contents && !allow_js_access) { |
2248 contents->web_contents()->GetController().LoadURL( | 2247 contents->web_contents()->GetController().LoadURL( |
2249 target_url, | 2248 target_url, |
2250 content::Referrer(), | 2249 content::Referrer(), |
2251 content::PAGE_TRANSITION_LINK, | 2250 content::PAGE_TRANSITION_LINK, |
2252 std::string()); // No extra headers. | 2251 std::string()); // No extra headers. |
2253 } | 2252 } |
2254 | 2253 |
2255 return contents != NULL; | 2254 return contents != NULL; |
2256 } | 2255 } |
OLD | NEW |