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/panels/panel.h" | 5 #include "chrome/browser/ui/panels/panel.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/extensions/extension_prefs.h" | 8 #include "chrome/browser/extensions/extension_prefs.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 void Panel::SetBounds(const gfx::Rect& bounds) { | 167 void Panel::SetBounds(const gfx::Rect& bounds) { |
168 // Ignore any SetBounds requests since the bounds are completely controlled | 168 // Ignore any SetBounds requests since the bounds are completely controlled |
169 // by panel manager. | 169 // by panel manager. |
170 } | 170 } |
171 | 171 |
172 // Close() may be called multiple times if the browser window is not ready to | 172 // Close() may be called multiple times if the browser window is not ready to |
173 // close on the first attempt. | 173 // close on the first attempt. |
174 void Panel::Close() { | 174 void Panel::Close() { |
175 native_panel_->ClosePanel(); | 175 native_panel_->ClosePanel(); |
176 | |
177 // TODO(dimich): Only implemented fully async on Mac. Need to update other | |
178 // platforms. The panel should be removed from PanelManager when and if it | |
179 // was actually closed. The closing can be cancelled because of onbeforeunload | |
180 // handler on the web page. http://crbug.com/102720 | |
181 #if !defined(OS_MACOSX) | |
182 manager()->Remove(this); | |
183 #endif | |
184 } | 176 } |
185 | 177 |
186 void Panel::Activate() { | 178 void Panel::Activate() { |
187 // Make sure the panel is expanded when activated programmatically, | 179 // Make sure the panel is expanded when activated programmatically, |
188 // so the user input does not go into collapsed window. | 180 // so the user input does not go into collapsed window. |
189 SetExpansionState(Panel::EXPANDED); | 181 SetExpansionState(Panel::EXPANDED); |
190 native_panel_->ActivatePanel(); | 182 native_panel_->ActivatePanel(); |
191 } | 183 } |
192 | 184 |
193 void Panel::Deactivate() { | 185 void Panel::Deactivate() { |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 RequestRenderViewHostToDisableScrollbars(GetRenderViewHost()); | 590 RequestRenderViewHostToDisableScrollbars(GetRenderViewHost()); |
599 } | 591 } |
600 | 592 |
601 Browser* Panel::browser() const { | 593 Browser* Panel::browser() const { |
602 return native_panel_->GetPanelBrowser(); | 594 return native_panel_->GetPanelBrowser(); |
603 } | 595 } |
604 | 596 |
605 void Panel::DestroyBrowser() { | 597 void Panel::DestroyBrowser() { |
606 native_panel_->DestroyPanelBrowser(); | 598 native_panel_->DestroyPanelBrowser(); |
607 } | 599 } |
OLD | NEW |