| OLD | NEW |
| 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 Loading... |
| 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 void BrowserWindowCocoa::UnhideDownloadShelf() { | 849 void BrowserWindowCocoa::UnhideDownloadShelf() { |
| 850 GetDownloadShelf()->Unhide(); | 850 GetDownloadShelf()->Unhide(); |
| 851 } | 851 } |
| 852 | 852 |
| 853 void BrowserWindowCocoa::HideDownloadShelf() { | 853 void BrowserWindowCocoa::HideDownloadShelf() { |
| 854 GetDownloadShelf()->Hide(); | 854 GetDownloadShelf()->Hide(); |
| 855 StatusBubble* statusBubble = GetStatusBubble(); | 855 StatusBubble* statusBubble = GetStatusBubble(); |
| 856 if (statusBubble) | 856 if (statusBubble) |
| 857 statusBubble->Hide(); | 857 statusBubble->Hide(); |
| 858 } | 858 } |
| OLD | NEW |