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/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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 ShowInactive(); | 168 ShowInactive(); |
169 else | 169 else |
170 native_panel_->ShowPanel(); | 170 native_panel_->ShowPanel(); |
171 } | 171 } |
172 | 172 |
173 void Panel::ShowInactive() { | 173 void Panel::ShowInactive() { |
174 native_panel_->ShowPanelInactive(); | 174 native_panel_->ShowPanelInactive(); |
175 } | 175 } |
176 | 176 |
177 void Panel::SetBounds(const gfx::Rect& bounds) { | 177 void Panel::SetBounds(const gfx::Rect& bounds) { |
178 // Ignore any SetBounds requests since the bounds are completely controlled | 178 // Ignore bounds position as the panel manager controls all positioning. |
179 // by panel manager. | 179 manager()->ResizePanel(this, bounds.size()); |
jianli
2012/01/11 00:29:13
For detached panel case, do we want to allow the A
jennb
2012/01/11 00:36:26
Probably, but that's future code.
| |
180 } | 180 } |
181 | 181 |
182 // Close() may be called multiple times if the browser window is not ready to | 182 // Close() may be called multiple times if the browser window is not ready to |
183 // close on the first attempt. | 183 // close on the first attempt. |
184 void Panel::Close() { | 184 void Panel::Close() { |
185 native_panel_->ClosePanel(); | 185 native_panel_->ClosePanel(); |
186 } | 186 } |
187 | 187 |
188 void Panel::Activate() { | 188 void Panel::Activate() { |
189 // Make sure the panel is expanded when activated programmatically, | 189 // Make sure the panel is expanded when activated programmatically, |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
637 native_panel_->ContentSizeFromWindowSize(max_size_)); | 637 native_panel_->ContentSizeFromWindowSize(max_size_)); |
638 } | 638 } |
639 | 639 |
640 void Panel::OnWindowSizeAvailable() { | 640 void Panel::OnWindowSizeAvailable() { |
641 ConfigureAutoResize(browser()->GetSelectedWebContents()); | 641 ConfigureAutoResize(browser()->GetSelectedWebContents()); |
642 } | 642 } |
643 | 643 |
644 void Panel::DestroyBrowser() { | 644 void Panel::DestroyBrowser() { |
645 native_panel_->DestroyPanelBrowser(); | 645 native_panel_->DestroyPanelBrowser(); |
646 } | 646 } |
OLD | NEW |