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

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

Issue 8774013: Add panel overflow logic to panel strip. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo, remove dummy code Created 9 years 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 | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | chrome/browser/ui/panels/panel_strip.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_manager.h" 5 #include "chrome/browser/ui/panels/panel_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_list.h" 10 #include "chrome/browser/ui/browser_list.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 void PanelManager::Layout() { 70 void PanelManager::Layout() {
71 int height = 71 int height =
72 static_cast<int>(adjusted_work_area_.height() * kPanelStripHeightFactor); 72 static_cast<int>(adjusted_work_area_.height() * kPanelStripHeightFactor);
73 gfx::Rect panel_strip_bounds; 73 gfx::Rect panel_strip_bounds;
74 panel_strip_bounds.set_x(adjusted_work_area_.x() + kPanelStripLeftMargin); 74 panel_strip_bounds.set_x(adjusted_work_area_.x() + kPanelStripLeftMargin);
75 panel_strip_bounds.set_y(adjusted_work_area_.bottom() - height); 75 panel_strip_bounds.set_y(adjusted_work_area_.bottom() - height);
76 panel_strip_bounds.set_width(adjusted_work_area_.width() - 76 panel_strip_bounds.set_width(adjusted_work_area_.width() -
77 kPanelStripLeftMargin - kPanelStripRightMargin); 77 kPanelStripLeftMargin - kPanelStripRightMargin);
78 panel_strip_bounds.set_height(height); 78 panel_strip_bounds.set_height(height);
79 panel_strip_->SetBounds(panel_strip_bounds); 79 panel_strip_->SetDisplayArea(panel_strip_bounds);
80 } 80 }
81 81
82 Panel* PanelManager::CreatePanel(Browser* browser) { 82 Panel* PanelManager::CreatePanel(Browser* browser) {
83 int width = browser->override_bounds().width(); 83 int width = browser->override_bounds().width();
84 int height = browser->override_bounds().height(); 84 int height = browser->override_bounds().height();
85 Panel* panel = new Panel(browser, gfx::Size(width, height)); 85 Panel* panel = new Panel(browser, gfx::Size(width, height));
86 panel_strip_->AddPanel(panel); 86 panel_strip_->AddPanel(panel);
87 87
88 content::NotificationService::current()->Notify( 88 content::NotificationService::current()->Notify(
89 chrome::NOTIFICATION_PANEL_ADDED, 89 chrome::NOTIFICATION_PANEL_ADDED,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // TODO(jianli): + overflow_strip_->num_panels(); 203 // TODO(jianli): + overflow_strip_->num_panels();
204 } 204 }
205 205
206 bool PanelManager::is_dragging_panel() const { 206 bool PanelManager::is_dragging_panel() const {
207 return panel_strip_->is_dragging_panel(); 207 return panel_strip_->is_dragging_panel();
208 } 208 }
209 209
210 const PanelManager::Panels& PanelManager::panels() const { 210 const PanelManager::Panels& PanelManager::panels() const {
211 return panel_strip_->panels(); 211 return panel_strip_->panels();
212 } 212 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | chrome/browser/ui/panels/panel_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698