| 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 "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 } | 199 } |
| 200 | 200 |
| 201 void Panel::SetPreviewMode(bool in_preview) { | 201 void Panel::SetPreviewMode(bool in_preview) { |
| 202 DCHECK_NE(in_preview_mode_, in_preview); | 202 DCHECK_NE(in_preview_mode_, in_preview); |
| 203 in_preview_mode_ = in_preview; | 203 in_preview_mode_ = in_preview; |
| 204 } | 204 } |
| 205 | 205 |
| 206 void Panel::SetExpansionState(ExpansionState new_state) { | 206 void Panel::SetExpansionState(ExpansionState new_state) { |
| 207 if (expansion_state_ == new_state) | 207 if (expansion_state_ == new_state) |
| 208 return; | 208 return; |
| 209 native_panel_->PanelExpansionStateChanging(expansion_state_, new_state); |
| 209 expansion_state_ = new_state; | 210 expansion_state_ = new_state; |
| 210 | 211 |
| 211 manager()->OnPanelExpansionStateChanged(this); | 212 manager()->OnPanelExpansionStateChanged(this); |
| 212 | 213 |
| 213 DCHECK(initialized_ && panel_strip_ != NULL); | 214 DCHECK(initialized_ && panel_strip_ != NULL); |
| 214 native_panel_->PreventActivationByOS(panel_strip_->IsPanelMinimized(this)); | 215 native_panel_->PreventActivationByOS(panel_strip_->IsPanelMinimized(this)); |
| 215 UpdateMinimizeRestoreButtonVisibility(); | 216 UpdateMinimizeRestoreButtonVisibility(); |
| 216 | 217 |
| 217 content::NotificationService::current()->Notify( | 218 content::NotificationService::current()->Notify( |
| 218 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, | 219 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 void Panel::OnPanelStartUserResizing() { | 436 void Panel::OnPanelStartUserResizing() { |
| 436 SetAutoResizable(false); | 437 SetAutoResizable(false); |
| 437 SetPreviewMode(true); | 438 SetPreviewMode(true); |
| 438 max_size_policy_ = CUSTOM_MAX_SIZE; | 439 max_size_policy_ = CUSTOM_MAX_SIZE; |
| 439 } | 440 } |
| 440 | 441 |
| 441 void Panel::OnPanelEndUserResizing() { | 442 void Panel::OnPanelEndUserResizing() { |
| 442 SetPreviewMode(false); | 443 SetPreviewMode(false); |
| 443 } | 444 } |
| 444 | 445 |
| OLD | NEW |