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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 PanelManager* Panel::manager() const { | 80 PanelManager* Panel::manager() const { |
81 return PanelManager::GetInstance(); | 81 return PanelManager::GetInstance(); |
82 } | 82 } |
83 | 83 |
84 bool Panel::draggable() const { | 84 bool Panel::draggable() const { |
85 return panel_strip_ && panel_strip_->CanDragPanel(this); | 85 return panel_strip_ && panel_strip_->CanDragPanel(this); |
86 } | 86 } |
87 | 87 |
88 bool Panel::CanResizeByMouse() const { | 88 panel::Resizability Panel::CanResizeByMouse() const { |
89 return panel_strip_ && panel_strip_->CanResizePanel(this); | 89 if (!panel_strip_) |
| 90 return panel::NOT_RESIZABLE; |
| 91 |
| 92 return panel_strip_->GetPanelResizability(this); |
90 } | 93 } |
91 | 94 |
92 const Extension* Panel::GetExtension() const { | 95 const Extension* Panel::GetExtension() const { |
93 return GetExtensionFromBrowser(browser()); | 96 return GetExtensionFromBrowser(browser()); |
94 } | 97 } |
95 | 98 |
96 // TODO(jennb): do not update restored_size here as there's no knowledge | 99 // TODO(jennb): do not update restored_size here as there's no knowledge |
97 // at this point whether the bounds change is due to the content window | 100 // at this point whether the bounds change is due to the content window |
98 // being resized vs a change in current display bounds, e.g. from overflow | 101 // being resized vs a change in current display bounds, e.g. from overflow |
99 // size change. Change this when refactoring panel resize logic. | 102 // size change. Change this when refactoring panel resize logic. |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 } | 749 } |
747 | 750 |
748 void Panel::OnTitlebarClicked(panel::ClickModifier modifier) { | 751 void Panel::OnTitlebarClicked(panel::ClickModifier modifier) { |
749 if (panel_strip_) | 752 if (panel_strip_) |
750 panel_strip_->OnPanelTitlebarClicked(this, modifier); | 753 panel_strip_->OnPanelTitlebarClicked(this, modifier); |
751 } | 754 } |
752 | 755 |
753 void Panel::DestroyBrowser() { | 756 void Panel::DestroyBrowser() { |
754 native_panel_->DestroyPanelBrowser(); | 757 native_panel_->DestroyPanelBrowser(); |
755 } | 758 } |
OLD | NEW |