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

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

Issue 9463022: Minimized panels should not open on Windows when activated by the OS (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: removed unnecessary include Created 8 years, 9 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
« no previous file with comments | « chrome/browser/ui/panels/native_panel.h ('k') | chrome/browser/ui/panels/panel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/panel_manager.h" 8 #include "chrome/browser/ui/panels/panel_manager.h"
9 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" 9 #include "chrome/browser/ui/panels/panel_mouse_watcher.h"
10 #include "chrome/browser/ui/panels/panel_overflow_indicator.h" 10 #include "chrome/browser/ui/panels/panel_overflow_indicator.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 void OverflowPanelStrip::UpdateCurrentWidth() { 76 void OverflowPanelStrip::UpdateCurrentWidth() {
77 current_display_width_ = are_overflow_titles_shown_ ? kOverflowAreaHoverWidth 77 current_display_width_ = are_overflow_titles_shown_ ? kOverflowAreaHoverWidth
78 : display_area_.width(); 78 : display_area_.width();
79 } 79 }
80 80
81 void OverflowPanelStrip::AddPanel(Panel* panel) { 81 void OverflowPanelStrip::AddPanel(Panel* panel) {
82 // TODO(jianli): consider using other container to improve the perf for 82 // TODO(jianli): consider using other container to improve the perf for
83 // inserting to the front. http://crbug.com/106222 83 // inserting to the front. http://crbug.com/106222
84 DCHECK_NE(this, panel->panel_strip()); 84 DCHECK_NE(this, panel->panel_strip());
85 panel->set_panel_strip(this); 85 panel->SetPanelStrip(this);
86 86
87 // Newly created panels that were temporarily in the panel strip 87 // Newly created panels that were temporarily in the panel strip
88 // are added to the back of the overflow, whereas panels that are 88 // are added to the back of the overflow, whereas panels that are
89 // bumped from the panel strip by other panels go to the front 89 // bumped from the panel strip by other panels go to the front
90 // of overflow. 90 // of overflow.
91 if (panel->has_temporary_layout()) { 91 if (panel->has_temporary_layout()) {
92 panel->set_has_temporary_layout(false); 92 panel->set_has_temporary_layout(false);
93 panels_.push_back(panel); 93 panels_.push_back(panel);
94 DoRefresh(panels_.size() - 1, panels_.size() - 1); 94 DoRefresh(panels_.size() - 1, panels_.size() - 1);
95 } else { 95 } else {
(...skipping 15 matching lines...) Expand all
111 if (num_panels() > max_visible_panels_) { 111 if (num_panels() > max_visible_panels_) {
112 if (!overflow_indicator_.get()) { 112 if (!overflow_indicator_.get()) {
113 overflow_indicator_.reset(PanelOverflowIndicator::Create()); 113 overflow_indicator_.reset(PanelOverflowIndicator::Create());
114 } 114 }
115 UpdateOverflowIndicatorCount(); 115 UpdateOverflowIndicatorCount();
116 } 116 }
117 } 117 }
118 118
119 void OverflowPanelStrip::RemovePanel(Panel* panel) { 119 void OverflowPanelStrip::RemovePanel(Panel* panel) {
120 DCHECK_EQ(this, panel->panel_strip()); 120 DCHECK_EQ(this, panel->panel_strip());
121 panel->set_panel_strip(NULL); 121 panel->SetPanelStrip(NULL);
122 122
123 size_t index = 0; 123 size_t index = 0;
124 Panels::iterator iter = panels_.begin(); 124 Panels::iterator iter = panels_.begin();
125 for (; iter != panels_.end(); ++iter, ++index) 125 for (; iter != panels_.end(); ++iter, ++index)
126 if (*iter == panel) 126 if (*iter == panel)
127 break; 127 break;
128 DCHECK(iter != panels_.end()); 128 DCHECK(iter != panels_.end());
129 129
130 panels_.erase(iter); 130 panels_.erase(iter);
131 DoRefresh(index, panels_.size() - 1); 131 DoRefresh(index, panels_.size() - 1);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 // expanded overflow panels when in full screen mode so no need 400 // expanded overflow panels when in full screen mode so no need
401 // to detect when mouse hovers over the overflow strip. 401 // to detect when mouse hovers over the overflow strip.
402 if (is_full_screen) 402 if (is_full_screen)
403 panel_manager_->mouse_watcher()->RemoveObserver(this); 403 panel_manager_->mouse_watcher()->RemoveObserver(this);
404 else 404 else
405 panel_manager_->mouse_watcher()->AddObserver(this); 405 panel_manager_->mouse_watcher()->AddObserver(this);
406 406
407 for (size_t i = 0; i < panels_.size(); ++i) 407 for (size_t i = 0; i < panels_.size(); ++i)
408 panels_[i]->FullScreenModeChanged(is_full_screen); 408 panels_[i]->FullScreenModeChanged(is_full_screen);
409 } 409 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/native_panel.h ('k') | chrome/browser/ui/panels/panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698