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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 TabContents* tab_contents = browser()->GetSelectedTabContents(); | 88 TabContents* tab_contents = browser()->GetSelectedTabContents(); |
89 if (tab_contents) | 89 if (tab_contents) |
90 EnableTabContentsAutoResize(tab_contents); | 90 EnableTabContentsAutoResize(tab_contents); |
91 } else { | 91 } else { |
92 browser()->tabstrip_model()->RemoveObserver(this); | 92 browser()->tabstrip_model()->RemoveObserver(this); |
93 registrar_.RemoveAll(); | 93 registrar_.RemoveAll(); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 void Panel::SetSizeRange(const gfx::Size& min_size, const gfx::Size& max_size) { | 97 void Panel::SetSizeRange(const gfx::Size& min_size, const gfx::Size& max_size) { |
| 98 if (min_size == min_size_ && max_size == max_size_) |
| 99 return; |
| 100 |
98 DCHECK(min_size.width() <= max_size.width()); | 101 DCHECK(min_size.width() <= max_size.width()); |
99 DCHECK(min_size.height() <= max_size.height()); | 102 DCHECK(min_size.height() <= max_size.height()); |
100 min_size_ = min_size; | 103 min_size_ = min_size; |
101 max_size_ = max_size; | 104 max_size_ = max_size; |
102 | 105 |
103 // Need to update the renderer on the new size range. | 106 // Need to update the renderer on the new size range. |
104 if (auto_resizable_) { | 107 if (auto_resizable_) { |
105 RenderViewHost* render_view_host = GetRenderViewHost(); | 108 RenderViewHost* render_view_host = GetRenderViewHost(); |
106 if (render_view_host) | 109 if (render_view_host) |
107 RequestRenderViewHostToDisableScrollbars(render_view_host); | 110 RequestRenderViewHostToDisableScrollbars(render_view_host); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 if (auto_resizable_) { | 638 if (auto_resizable_) { |
636 RenderViewHost* render_view_host = GetRenderViewHost(); | 639 RenderViewHost* render_view_host = GetRenderViewHost(); |
637 if (render_view_host) | 640 if (render_view_host) |
638 RequestRenderViewHostToDisableScrollbars(render_view_host); | 641 RequestRenderViewHostToDisableScrollbars(render_view_host); |
639 } | 642 } |
640 } | 643 } |
641 | 644 |
642 void Panel::DestroyBrowser() { | 645 void Panel::DestroyBrowser() { |
643 native_panel_->DestroyPanelBrowser(); | 646 native_panel_->DestroyPanelBrowser(); |
644 } | 647 } |
OLD | NEW |