OLD | NEW |
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 gfx::Size SideTabStrip::GetPreferredSize() { | 124 gfx::Size SideTabStrip::GetPreferredSize() { |
125 return gfx::Size(kTabStripWidth, 0); | 125 return gfx::Size(kTabStripWidth, 0); |
126 } | 126 } |
127 | 127 |
128 void SideTabStrip::PaintChildren(gfx::Canvas* canvas) { | 128 void SideTabStrip::PaintChildren(gfx::Canvas* canvas) { |
129 // Make sure the dragged tab appears on top of all others by paint it last. | 129 // Make sure the dragged tab appears on top of all others by paint it last. |
130 BaseTab* dragging_tab = NULL; | 130 BaseTab* dragging_tab = NULL; |
131 | 131 |
132 // Paint the new tab and separator first so that any tabs animating appear on | 132 // Paint the new tab and separator first so that any tabs animating appear on |
133 // top. | 133 // top. |
134 separator_->ProcessPaint(canvas); | 134 separator_->Paint(canvas); |
135 newtab_button_->ProcessPaint(canvas); | 135 newtab_button_->Paint(canvas); |
136 | 136 |
137 for (int i = tab_count() - 1; i >= 0; --i) { | 137 for (int i = tab_count() - 1; i >= 0; --i) { |
138 BaseTab* tab = base_tab_at_tab_index(i); | 138 BaseTab* tab = base_tab_at_tab_index(i); |
139 if (tab->dragging()) | 139 if (tab->dragging()) |
140 dragging_tab = tab; | 140 dragging_tab = tab; |
141 else | 141 else |
142 tab->ProcessPaint(canvas); | 142 tab->Paint(canvas); |
143 } | 143 } |
144 | 144 |
145 if (dragging_tab) | 145 if (dragging_tab) |
146 dragging_tab->ProcessPaint(canvas); | 146 dragging_tab->Paint(canvas); |
147 } | 147 } |
148 | 148 |
149 BaseTab* SideTabStrip::CreateTab() { | 149 BaseTab* SideTabStrip::CreateTab() { |
150 return new SideTab(this); | 150 return new SideTab(this); |
151 } | 151 } |
152 | 152 |
153 void SideTabStrip::GenerateIdealBounds() { | 153 void SideTabStrip::GenerateIdealBounds() { |
154 gfx::Rect layout_rect = GetContentsBounds(); | 154 gfx::Rect layout_rect = GetContentsBounds(); |
155 layout_rect.Inset(kTabStripInset, kTabStripInset); | 155 layout_rect.Inset(kTabStripInset, kTabStripInset); |
156 | 156 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 bounds_animator().AnimateViewTo(separator_, separator_bounds_); | 222 bounds_animator().AnimateViewTo(separator_, separator_bounds_); |
223 } | 223 } |
224 | 224 |
225 void SideTabStrip::DoLayout() { | 225 void SideTabStrip::DoLayout() { |
226 BaseTabStrip::DoLayout(); | 226 BaseTabStrip::DoLayout(); |
227 | 227 |
228 newtab_button_->SetBoundsRect(newtab_button_bounds_); | 228 newtab_button_->SetBoundsRect(newtab_button_bounds_); |
229 | 229 |
230 separator_->SetBoundsRect(separator_bounds_); | 230 separator_->SetBoundsRect(separator_bounds_); |
231 } | 231 } |
OLD | NEW |