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

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

Issue 10106008: Change Panel titlebars to activate the panel on click (rather than minimize). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win compile Created 8 years, 8 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
« no previous file with comments | « no previous file | 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/docked_panel_strip.h" 5 #include "chrome/browser/ui/panels/docked_panel_strip.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 } else { 466 } else {
467 // Maybe bring down the titlebar now that panel is not drawing attention. 467 // Maybe bring down the titlebar now that panel is not drawing attention.
468 if (panel->expansion_state() == Panel::TITLE_ONLY && !are_titlebars_up_) 468 if (panel->expansion_state() == Panel::TITLE_ONLY && !are_titlebars_up_)
469 panel->SetExpansionState(Panel::MINIMIZED); 469 panel->SetExpansionState(Panel::MINIMIZED);
470 } 470 }
471 } 471 }
472 472
473 void DockedPanelStrip::OnPanelTitlebarClicked(Panel* panel, 473 void DockedPanelStrip::OnPanelTitlebarClicked(Panel* panel,
474 panel::ClickModifier modifier) { 474 panel::ClickModifier modifier) {
475 DCHECK_EQ(this, panel->panel_strip()); 475 DCHECK_EQ(this, panel->panel_strip());
476 if (!IsPanelMinimized(panel))
477 return;
478
476 if (modifier == panel::APPLY_TO_ALL) 479 if (modifier == panel::APPLY_TO_ALL)
477 ToggleMinimizeAll(panel); 480 ToggleMinimizeAll(panel);
478 481 else
479 // TODO(jennb): Move all other titlebar click handling here. 482 RestorePanel(panel);
480 // (http://crbug.com/118431)
481 } 483 }
482 484
483 void DockedPanelStrip::ActivatePanel(Panel* panel) { 485 void DockedPanelStrip::ActivatePanel(Panel* panel) {
484 DCHECK_EQ(this, panel->panel_strip()); 486 DCHECK_EQ(this, panel->panel_strip());
485 487
486 // Make sure the panel is expanded when activated so the user input 488 // Make sure the panel is expanded when activated so the user input
487 // does not go into a collapsed window. 489 // does not go into a collapsed window.
488 panel->SetExpansionState(Panel::EXPANDED); 490 panel->SetExpansionState(Panel::EXPANDED);
489 491
490 // If the layout needs to be refreshed, it will happen in response to 492 // If the layout needs to be refreshed, it will happen in response to
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 FROM_HERE, 886 FROM_HERE,
885 base::Bind(&DockedPanelStrip::RefreshLayout, 887 base::Bind(&DockedPanelStrip::RefreshLayout,
886 refresh_action_factory_.GetWeakPtr()), 888 refresh_action_factory_.GetWeakPtr()),
887 base::TimeDelta::FromMilliseconds(PanelManager::AdjustTimeInterval( 889 base::TimeDelta::FromMilliseconds(PanelManager::AdjustTimeInterval(
888 kRefreshLayoutAfterActivePanelChangeDelayMs))); 890 kRefreshLayoutAfterActivePanelChangeDelayMs)));
889 } 891 }
890 892
891 bool DockedPanelStrip::HasPanel(Panel* panel) const { 893 bool DockedPanelStrip::HasPanel(Panel* panel) const {
892 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); 894 return find(panels_.begin(), panels_.end(), panel) != panels_.end();
893 } 895 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698