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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 2773973002: Add Startup.BrowserView.FirstPaint / .CompositingEnded histograms. (Closed)
Patch Set: Don't wait for histograms that are not reported during browser_tests. Created 3 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/cocoa/browser_window_cocoa.h" 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #import "base/mac/sdk_forward_declarations.h" 10 #import "base/mac/sdk_forward_declarations.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/sys_string_conversions.h" 13 #include "base/strings/sys_string_conversions.h"
14 #include "chrome/app/chrome_command_ids.h" 14 #include "chrome/app/chrome_command_ids.h"
15 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/download/download_shelf.h" 16 #include "chrome/browser/download/download_shelf.h"
17 #include "chrome/browser/extensions/extension_util.h" 17 #include "chrome/browser/extensions/extension_util.h"
18 #include "chrome/browser/extensions/tab_helper.h" 18 #include "chrome/browser/extensions/tab_helper.h"
19 #include "chrome/browser/metrics/browser_window_histogram_helper.h"
19 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/profiles/profile_window.h" 21 #include "chrome/browser/profiles/profile_window.h"
21 #include "chrome/browser/shell_integration.h" 22 #include "chrome/browser/shell_integration.h"
22 #include "chrome/browser/signin/chrome_signin_helper.h" 23 #include "chrome/browser/signin/chrome_signin_helper.h"
23 #include "chrome/browser/translate/chrome_translate_client.h" 24 #include "chrome/browser/translate/chrome_translate_client.h"
24 #include "chrome/browser/ui/browser.h" 25 #include "chrome/browser/ui/browser.h"
25 #include "chrome/browser/ui/browser_command_controller.h" 26 #include "chrome/browser/ui/browser_command_controller.h"
26 #include "chrome/browser/ui/browser_commands.h" 27 #include "chrome/browser/ui/browser_commands.h"
27 #include "chrome/browser/ui/browser_dialogs.h" 28 #include "chrome/browser/ui/browser_dialogs.h"
28 #include "chrome/browser/ui/browser_list.h" 29 #include "chrome/browser/ui/browser_list.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 saved_animation_behavior = [window() animationBehavior]; 169 saved_animation_behavior = [window() animationBehavior];
169 [window() setAnimationBehavior:NSWindowAnimationBehaviorNone]; 170 [window() setAnimationBehavior:NSWindowAnimationBehaviorNone];
170 } 171 }
171 172
172 { 173 {
173 TRACE_EVENT0("ui", "BrowserWindowCocoa::Show makeKeyAndOrderFront"); 174 TRACE_EVENT0("ui", "BrowserWindowCocoa::Show makeKeyAndOrderFront");
174 // This call takes up a substantial part of startup time, and an even more 175 // This call takes up a substantial part of startup time, and an even more
175 // substantial part of startup time when any CALayers are part of the 176 // substantial part of startup time when any CALayers are part of the
176 // window's NSView heirarchy. 177 // window's NSView heirarchy.
177 [window() makeKeyAndOrderFront:controller_]; 178 [window() makeKeyAndOrderFront:controller_];
179
180 // At this point all the Browser's UI is painted on the screen. There's no
181 // need to wait for the compositor, so pass the nullptr instead and don't
182 // store the returned instance.
183 BrowserWindowHistogramHelper::
184 MaybeRecordValueAndCreateInstanceOnBrowserPaint(nullptr);
178 } 185 }
179 186
180 // When creating windows from nibs it is necessary to |makeKeyAndOrderFront:| 187 // When creating windows from nibs it is necessary to |makeKeyAndOrderFront:|
181 // prior to |orderOut:| then |miniaturize:| when restoring windows in the 188 // prior to |orderOut:| then |miniaturize:| when restoring windows in the
182 // minimized state. 189 // minimized state.
183 if (initial_show_state_ == ui::SHOW_STATE_MINIMIZED) { 190 if (initial_show_state_ == ui::SHOW_STATE_MINIMIZED) {
184 [window() orderOut:controller_]; 191 [window() orderOut:controller_];
185 [window() miniaturize:controller_]; 192 [window() miniaturize:controller_];
186 } else if (initial_show_state_ == ui::SHOW_STATE_FULLSCREEN) { 193 } else if (initial_show_state_ == ui::SHOW_STATE_FULLSCREEN) {
187 chrome::ToggleFullscreenMode(browser_); 194 chrome::ToggleFullscreenMode(browser_);
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { 858 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() {
852 return [controller_ exclusiveAccessController]; 859 return [controller_ exclusiveAccessController];
853 } 860 }
854 861
855 void BrowserWindowCocoa::ShowImeWarningBubble( 862 void BrowserWindowCocoa::ShowImeWarningBubble(
856 const extensions::Extension* extension, 863 const extensions::Extension* extension,
857 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& 864 const base::Callback<void(ImeWarningBubblePermissionStatus status)>&
858 callback) { 865 callback) {
859 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; 866 NOTREACHED() << "The IME warning bubble is unsupported on this platform.";
860 } 867 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/startup_metrics_browsertest.cc ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698