Chromium Code Reviews| 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/overflow_panel_strip.h" | 5 #include "chrome/browser/ui/panels/overflow_panel_strip.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ui/panels/docked_panel_strip.h" | 8 #include "chrome/browser/ui/panels/docked_panel_strip.h" |
| 9 #include "chrome/browser/ui/panels/panel_manager.h" | 9 #include "chrome/browser/ui/panels/panel_manager.h" |
| 10 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" | 10 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 PanelStrip* docked_strip = panel_manager_->docked_strip(); | 178 PanelStrip* docked_strip = panel_manager_->docked_strip(); |
| 179 panel->MoveToStrip(docked_strip); | 179 panel->MoveToStrip(docked_strip); |
| 180 docked_strip->RestorePanel(panel); | 180 docked_strip->RestorePanel(panel); |
| 181 } | 181 } |
| 182 | 182 |
| 183 bool OverflowPanelStrip::CanShowPanelAsActive(const Panel* panel) const { | 183 bool OverflowPanelStrip::CanShowPanelAsActive(const Panel* panel) const { |
| 184 // All overflow panels cannot be shown as active. | 184 // All overflow panels cannot be shown as active. |
| 185 return false; | 185 return false; |
| 186 } | 186 } |
| 187 | 187 |
| 188 void OverflowPanelStrip::SavePanelPlacement(Panel* panel) { | |
|
jennb
2012/03/03 02:19:33
nit: (and probably overkill) but feels like this i
jianli
2012/03/07 19:14:31
Will add DraggableStrip if we have more strips lat
| |
| 189 NOTREACHED(); | |
| 190 } | |
| 191 | |
| 192 void OverflowPanelStrip::LoadSavedPanelPlacement() { | |
| 193 NOTREACHED(); | |
| 194 } | |
| 195 | |
| 196 void OverflowPanelStrip::DiscardSavedPanelPlacement() { | |
| 197 NOTREACHED(); | |
| 198 } | |
| 199 | |
| 188 bool OverflowPanelStrip::CanDragPanel(const Panel* panel) const { | 200 bool OverflowPanelStrip::CanDragPanel(const Panel* panel) const { |
| 189 // All overflow panels are not draggable. | 201 // All overflow panels are not draggable. |
| 190 return false; | 202 return false; |
| 191 } | 203 } |
| 192 | 204 |
| 193 void OverflowPanelStrip::StartDraggingPanel(Panel* panel) { | 205 void OverflowPanelStrip::StartDraggingPanelLocally(Panel* panel) { |
| 194 NOTREACHED(); | 206 NOTREACHED(); |
| 195 } | 207 } |
| 196 | 208 |
| 197 void OverflowPanelStrip::DragPanel(Panel* panel, int delta_x, int delta_y) { | 209 void OverflowPanelStrip::DragPanelLocally(Panel* panel, |
| 210 int delta_x, | |
| 211 int delta_y) { | |
| 198 NOTREACHED(); | 212 NOTREACHED(); |
| 199 } | 213 } |
| 200 | 214 |
| 201 void OverflowPanelStrip::EndDraggingPanel(Panel* panel, bool cancelled) { | 215 void OverflowPanelStrip::EndDraggingPanelLocally(Panel* panel, bool cancelled) { |
| 202 NOTREACHED(); | 216 NOTREACHED(); |
| 203 } | 217 } |
| 204 | 218 |
| 219 void OverflowPanelStrip::AddDraggingPanel(Panel* panel, | |
| 220 const gfx::Point& position) { | |
| 221 NOTREACHED(); | |
| 222 } | |
| 223 | |
| 205 void OverflowPanelStrip::RefreshLayout() { | 224 void OverflowPanelStrip::RefreshLayout() { |
| 206 if (panels_.empty()) | 225 if (panels_.empty()) |
| 207 return; | 226 return; |
| 208 DoRefresh(0, panels_.size() - 1); | 227 DoRefresh(0, panels_.size() - 1); |
| 209 } | 228 } |
| 210 | 229 |
| 211 void OverflowPanelStrip::DoRefresh(size_t start_index, size_t end_index) { | 230 void OverflowPanelStrip::DoRefresh(size_t start_index, size_t end_index) { |
| 212 if (panels_.empty() || start_index == panels_.size()) | 231 if (panels_.empty() || start_index == panels_.size()) |
| 213 return; | 232 return; |
| 214 | 233 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 // expanded overflow panels when in full screen mode so no need | 414 // expanded overflow panels when in full screen mode so no need |
| 396 // to detect when mouse hovers over the overflow strip. | 415 // to detect when mouse hovers over the overflow strip. |
| 397 if (is_full_screen) | 416 if (is_full_screen) |
| 398 panel_manager_->mouse_watcher()->RemoveObserver(this); | 417 panel_manager_->mouse_watcher()->RemoveObserver(this); |
| 399 else | 418 else |
| 400 panel_manager_->mouse_watcher()->AddObserver(this); | 419 panel_manager_->mouse_watcher()->AddObserver(this); |
| 401 | 420 |
| 402 for (size_t i = 0; i < panels_.size(); ++i) | 421 for (size_t i = 0; i < panels_.size(); ++i) |
| 403 panels_[i]->FullScreenModeChanged(is_full_screen); | 422 panels_[i]->FullScreenModeChanged(is_full_screen); |
| 404 } | 423 } |
| OLD | NEW |