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 "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 | 254 |
255 panel::Resizability Panel::CanResizeByMouse() const { | 255 panel::Resizability Panel::CanResizeByMouse() const { |
256 if (!panel_strip_) | 256 if (!panel_strip_) |
257 return panel::NOT_RESIZABLE; | 257 return panel::NOT_RESIZABLE; |
258 | 258 |
259 return panel_strip_->GetPanelResizability(this); | 259 return panel_strip_->GetPanelResizability(this); |
260 } | 260 } |
261 | 261 |
262 void Panel::SetPanelBounds(const gfx::Rect& bounds) { | 262 void Panel::SetPanelBounds(const gfx::Rect& bounds) { |
263 native_panel_->SetPanelBounds(bounds); | 263 if (bounds != native_panel_->GetPanelBounds()) |
| 264 native_panel_->SetPanelBounds(bounds); |
264 } | 265 } |
265 | 266 |
266 void Panel::SetPanelBoundsInstantly(const gfx::Rect& bounds) { | 267 void Panel::SetPanelBoundsInstantly(const gfx::Rect& bounds) { |
267 native_panel_->SetPanelBoundsInstantly(bounds); | 268 native_panel_->SetPanelBoundsInstantly(bounds); |
268 } | 269 } |
269 | 270 |
270 void Panel::LimitSizeToDisplayArea(const gfx::Rect& display_area) { | 271 void Panel::LimitSizeToDisplayArea(const gfx::Rect& display_area) { |
271 int max_width = manager()->GetMaxPanelWidth(); | 272 int max_width = manager()->GetMaxPanelWidth(); |
272 int max_height = manager()->GetMaxPanelHeight(); | 273 int max_height = manager()->GetMaxPanelHeight(); |
273 | 274 |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 | 778 |
778 void Panel::LoadingStateChanged(bool is_loading) { | 779 void Panel::LoadingStateChanged(bool is_loading) { |
779 command_updater_.UpdateCommandEnabled(IDC_STOP, is_loading); | 780 command_updater_.UpdateCommandEnabled(IDC_STOP, is_loading); |
780 native_panel_->UpdatePanelLoadingAnimations(is_loading); | 781 native_panel_->UpdatePanelLoadingAnimations(is_loading); |
781 UpdateTitleBar(); | 782 UpdateTitleBar(); |
782 } | 783 } |
783 | 784 |
784 void Panel::WebContentsFocused(content::WebContents* contents) { | 785 void Panel::WebContentsFocused(content::WebContents* contents) { |
785 native_panel_->PanelWebContentsFocused(contents); | 786 native_panel_->PanelWebContentsFocused(contents); |
786 } | 787 } |
OLD | NEW |