OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 [controller_ deferPerformClose]; | 106 [controller_ deferPerformClose]; |
107 } else { | 107 } else { |
108 // Make sure we hide the window immediately. Even though performClose: | 108 // Make sure we hide the window immediately. Even though performClose: |
109 // calls orderOut: eventually, it leaves the window on-screen long enough | 109 // calls orderOut: eventually, it leaves the window on-screen long enough |
110 // that we start to see tabs shutting down. http://crbug.com/23959 | 110 // that we start to see tabs shutting down. http://crbug.com/23959 |
111 // TODO(viettrungluu): This is kind of bad, since |-performClose:| calls | 111 // TODO(viettrungluu): This is kind of bad, since |-performClose:| calls |
112 // |-windowShouldClose:| (on its delegate, which is probably the | 112 // |-windowShouldClose:| (on its delegate, which is probably the |
113 // controller) which may return |NO| causing the window to not be closed, | 113 // controller) which may return |NO| causing the window to not be closed, |
114 // thereby leaving a hidden window. In fact, our window-closing procedure | 114 // thereby leaving a hidden window. In fact, our window-closing procedure |
115 // involves a (indirect) recursion on |-performClose:|, which is also bad. | 115 // involves a (indirect) recursion on |-performClose:|, which is also bad. |
116 LOG(INFO) << "BrowserWindowCocoa::Close()"; | |
jennb
2011/08/22 19:13:02
Did you mean to keep this debugging aid in the pat
| |
116 [window() orderOut:controller_]; | 117 [window() orderOut:controller_]; |
117 [window() performClose:controller_]; | 118 [window() performClose:controller_]; |
118 } | 119 } |
119 } | 120 } |
120 | 121 |
121 void BrowserWindowCocoa::Activate() { | 122 void BrowserWindowCocoa::Activate() { |
122 [controller_ activate]; | 123 [controller_ activate]; |
123 } | 124 } |
124 | 125 |
125 void BrowserWindowCocoa::Deactivate() { | 126 void BrowserWindowCocoa::Deactivate() { |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
633 | 634 |
634 NSWindow* BrowserWindowCocoa::window() const { | 635 NSWindow* BrowserWindowCocoa::window() const { |
635 return [controller_ window]; | 636 return [controller_ window]; |
636 } | 637 } |
637 | 638 |
638 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { | 639 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { |
639 if (tab_contents == browser_->GetSelectedTabContents()) { | 640 if (tab_contents == browser_->GetSelectedTabContents()) { |
640 [controller_ updateSidebarForContents:tab_contents]; | 641 [controller_ updateSidebarForContents:tab_contents]; |
641 } | 642 } |
642 } | 643 } |
OLD | NEW |