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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 TabContents* tab_contents = browser()->GetSelectedTabContents(); | 100 TabContents* tab_contents = browser()->GetSelectedTabContents(); |
101 if (tab_contents) | 101 if (tab_contents) |
102 EnableTabContentsAutoResize(tab_contents); | 102 EnableTabContentsAutoResize(tab_contents); |
103 } else { | 103 } else { |
104 browser()->tabstrip_model()->RemoveObserver(this); | 104 browser()->tabstrip_model()->RemoveObserver(this); |
105 registrar_.RemoveAll(); | 105 registrar_.RemoveAll(); |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 void Panel::SetSizeRange(const gfx::Size& min_size, const gfx::Size& max_size) { | 109 void Panel::SetSizeRange(const gfx::Size& min_size, const gfx::Size& max_size) { |
| 110 if (min_size == min_size_ && max_size == max_size_) |
| 111 return; |
| 112 |
110 DCHECK(min_size.width() <= max_size.width()); | 113 DCHECK(min_size.width() <= max_size.width()); |
111 DCHECK(min_size.height() <= max_size.height()); | 114 DCHECK(min_size.height() <= max_size.height()); |
112 min_size_ = min_size; | 115 min_size_ = min_size; |
113 max_size_ = max_size; | 116 max_size_ = max_size; |
114 | 117 |
115 // Need to update the renderer on the new size range. | 118 // Need to update the renderer on the new size range. |
116 if (auto_resizable_) { | 119 if (auto_resizable_) { |
117 RenderViewHost* render_view_host = GetRenderViewHost(); | 120 RenderViewHost* render_view_host = GetRenderViewHost(); |
118 if (render_view_host) | 121 if (render_view_host) |
119 RequestRenderViewHostToDisableScrollbars(render_view_host); | 122 RequestRenderViewHostToDisableScrollbars(render_view_host); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 if (auto_resizable_) { | 650 if (auto_resizable_) { |
648 RenderViewHost* render_view_host = GetRenderViewHost(); | 651 RenderViewHost* render_view_host = GetRenderViewHost(); |
649 if (render_view_host) | 652 if (render_view_host) |
650 RequestRenderViewHostToDisableScrollbars(render_view_host); | 653 RequestRenderViewHostToDisableScrollbars(render_view_host); |
651 } | 654 } |
652 } | 655 } |
653 | 656 |
654 void Panel::DestroyBrowser() { | 657 void Panel::DestroyBrowser() { |
655 native_panel_->DestroyPanelBrowser(); | 658 native_panel_->DestroyPanelBrowser(); |
656 } | 659 } |
OLD | NEW |