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

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

Issue 1358333002: (Merge to M45): Revert of BrowserWindowCocoa::Show should activate the window (patchset #1 id:1 of … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2454
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // Turn off swishing when restoring windows or showing an app. 161 // Turn off swishing when restoring windows or showing an app.
162 if ((is_session_restore || browser_->is_app()) && 162 if ((is_session_restore || browser_->is_app()) &&
163 [window() respondsToSelector:@selector(animationBehavior)] && 163 [window() respondsToSelector:@selector(animationBehavior)] &&
164 [window() respondsToSelector:@selector(setAnimationBehavior:)]) { 164 [window() respondsToSelector:@selector(setAnimationBehavior:)]) {
165 did_save_animation_behavior = true; 165 did_save_animation_behavior = true;
166 saved_animation_behavior = [window() animationBehavior]; 166 saved_animation_behavior = [window() animationBehavior];
167 [window() setAnimationBehavior:NSWindowAnimationBehaviorNone]; 167 [window() setAnimationBehavior:NSWindowAnimationBehaviorNone];
168 } 168 }
169 169
170 { 170 {
171 TRACE_EVENT0("ui", "BrowserWindowCocoa::Show Activate"); 171 TRACE_EVENT0("ui", "BrowserWindowCocoa::Show makeKeyAndOrderFront");
172 // This call takes up a substantial part of startup time, and an even more 172 // This call takes up a substantial part of startup time, and an even more
173 // substantial part of startup time when any CALayers are part of the 173 // substantial part of startup time when any CALayers are part of the
174 // window's NSView heirarchy. 174 // window's NSView heirarchy.
175 Activate(); 175 [window() makeKeyAndOrderFront:controller_];
176 } 176 }
177 177
178 // When creating windows from nibs it is necessary to |makeKeyAndOrderFront:| 178 // When creating windows from nibs it is necessary to |makeKeyAndOrderFront:|
179 // prior to |orderOut:| then |miniaturize:| when restoring windows in the 179 // prior to |orderOut:| then |miniaturize:| when restoring windows in the
180 // minimized state. 180 // minimized state.
181 if (initial_show_state_ == ui::SHOW_STATE_MINIMIZED) { 181 if (initial_show_state_ == ui::SHOW_STATE_MINIMIZED) {
182 [window() orderOut:controller_]; 182 [window() orderOut:controller_];
183 [window() miniaturize:controller_]; 183 [window() miniaturize:controller_];
184 } else if (initial_show_state_ == ui::SHOW_STATE_FULLSCREEN) { 184 } else if (initial_show_state_ == ui::SHOW_STATE_FULLSCREEN) {
185 chrome::ToggleFullscreenWithToolbarOrFallback(browser_); 185 chrome::ToggleFullscreenWithToolbarOrFallback(browser_);
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 void BrowserWindowCocoa::UnhideDownloadShelf() { 845 void BrowserWindowCocoa::UnhideDownloadShelf() {
846 GetDownloadShelf()->Unhide(); 846 GetDownloadShelf()->Unhide();
847 } 847 }
848 848
849 void BrowserWindowCocoa::HideDownloadShelf() { 849 void BrowserWindowCocoa::HideDownloadShelf() {
850 GetDownloadShelf()->Hide(); 850 GetDownloadShelf()->Hide();
851 StatusBubble* statusBubble = GetStatusBubble(); 851 StatusBubble* statusBubble = GetStatusBubble();
852 if (statusBubble) 852 if (statusBubble)
853 statusBubble->Hide(); 853 statusBubble->Hide();
854 } 854 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698