Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1281)

Side by Side Diff: chrome/browser/ui/panels/overflow_panel_strip.cc

Issue 9129013: Panel Overflow on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cr feedback Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // of overflow. 88 // of overflow.
89 if (panel->has_temporary_layout()) { 89 if (panel->has_temporary_layout()) {
90 panel->set_has_temporary_layout(false); 90 panel->set_has_temporary_layout(false);
91 panels_.push_back(panel); 91 panels_.push_back(panel);
92 DoRefresh(panels_.size() - 1, panels_.size() - 1); 92 DoRefresh(panels_.size() - 1, panels_.size() - 1);
93 } else { 93 } else {
94 panels_.insert(panels_.begin(), panel); 94 panels_.insert(panels_.begin(), panel);
95 Refresh(); 95 Refresh();
96 } 96 }
97 97
98 panel->ApplyVisualStyleForStrip(OVERFLOW_STRIP);
99
98 if (num_panels() == 1) { 100 if (num_panels() == 1) {
99 panel_manager_->mouse_watcher()->AddObserver(this); 101 panel_manager_->mouse_watcher()->AddObserver(this);
100 UpdateMaxVisiblePanelsOnHover(); 102 UpdateMaxVisiblePanelsOnHover();
101 } 103 }
102 104
103 // Update the overflow indicator only when the number of overflow panels go 105 // Update the overflow indicator only when the number of overflow panels go
104 // beyond the maximum visible limit. 106 // beyond the maximum visible limit.
105 if (num_panels() > max_visible_panels_) { 107 if (num_panels() > max_visible_panels_) {
106 if (!overflow_indicator_.get()) { 108 if (!overflow_indicator_.get()) {
107 overflow_indicator_.reset(PanelOverflowIndicator::Create()); 109 overflow_indicator_.reset(PanelOverflowIndicator::Create());
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 bounds.set_width(current_display_width); 346 bounds.set_width(current_display_width);
345 overflow_indicator_->SetBounds(bounds); 347 overflow_indicator_->SetBounds(bounds);
346 overflow_indicator_->SetCount(num_panels() - max_visible_panels); 348 overflow_indicator_->SetCount(num_panels() - max_visible_panels);
347 } 349 }
348 } 350 }
349 351
350 void OverflowPanelStrip::OnFullScreenModeChanged(bool is_full_screen) { 352 void OverflowPanelStrip::OnFullScreenModeChanged(bool is_full_screen) {
351 for (size_t i = 0; i < panels_.size(); ++i) 353 for (size_t i = 0; i < panels_.size(); ++i)
352 panels_[i]->FullScreenModeChanged(is_full_screen); 354 panels_[i]->FullScreenModeChanged(is_full_screen);
353 } 355 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698