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

Side by Side Diff: chrome/browser/ui/views/tabs/side_tab_strip.cc

Issue 6462022: It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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) 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/views/tabs/side_tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/side_tab_strip.h"
6 6
7 #include "chrome/browser/ui/view_ids.h" 7 #include "chrome/browser/ui/view_ids.h"
8 #include "chrome/browser/ui/views/tabs/side_tab.h" 8 #include "chrome/browser/ui/views/tabs/side_tab.h"
9 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" 9 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 if (dragging_tab) 149 if (dragging_tab)
150 dragging_tab->ProcessPaint(canvas); 150 dragging_tab->ProcessPaint(canvas);
151 } 151 }
152 152
153 BaseTab* SideTabStrip::CreateTab() { 153 BaseTab* SideTabStrip::CreateTab() {
154 return new SideTab(this); 154 return new SideTab(this);
155 } 155 }
156 156
157 void SideTabStrip::GenerateIdealBounds() { 157 void SideTabStrip::GenerateIdealBounds() {
158 gfx::Rect layout_rect = GetLocalBounds(); 158 gfx::Rect layout_rect = GetContentsBounds();
159 layout_rect.Inset(kTabStripInset, kTabStripInset); 159 layout_rect.Inset(kTabStripInset, kTabStripInset);
160 160
161 int y = layout_rect.y(); 161 int y = layout_rect.y();
162 bool last_was_mini = true; 162 bool last_was_mini = true;
163 bool has_non_closing_tab = false; 163 bool has_non_closing_tab = false;
164 separator_bounds_.SetRect(0, -kSeparatorHeight, width(), kSeparatorHeight); 164 separator_bounds_.SetRect(0, -kSeparatorHeight, width(), kSeparatorHeight);
165 for (int i = 0; i < tab_count(); ++i) { 165 for (int i = 0; i < tab_count(); ++i) {
166 BaseTab* tab = base_tab_at_tab_index(i); 166 BaseTab* tab = base_tab_at_tab_index(i);
167 if (!tab->closing()) { 167 if (!tab->closing()) {
168 if (last_was_mini != tab->data().mini) { 168 if (last_was_mini != tab->data().mini) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 bounds_animator().AnimateViewTo(separator_, separator_bounds_); 226 bounds_animator().AnimateViewTo(separator_, separator_bounds_);
227 } 227 }
228 228
229 void SideTabStrip::DoLayout() { 229 void SideTabStrip::DoLayout() {
230 BaseTabStrip::DoLayout(); 230 BaseTabStrip::DoLayout();
231 231
232 newtab_button_->SetBoundsRect(newtab_button_bounds_); 232 newtab_button_->SetBoundsRect(newtab_button_bounds_);
233 233
234 separator_->SetBoundsRect(separator_bounds_); 234 separator_->SetBoundsRect(separator_bounds_);
235 } 235 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698