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

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

Issue 6452011: Rework tree APIs to reflect Google style and more const-correctness.... (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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/task_manager_view.cc » ('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/views/tabs/tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/tab_strip.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 303
304 // Paint the New Tab button. 304 // Paint the New Tab button.
305 newtab_button_->ProcessPaint(canvas); 305 newtab_button_->ProcessPaint(canvas);
306 306
307 // And the dragged tab. 307 // And the dragged tab.
308 if (dragging_tab) 308 if (dragging_tab)
309 dragging_tab->ProcessPaint(canvas); 309 dragging_tab->ProcessPaint(canvas);
310 } 310 }
311 311
312 // Overridden to support automation. See automation_proxy_uitest.cc. 312 // Overridden to support automation. See automation_proxy_uitest.cc.
313 views::View* TabStrip::GetViewByID(int view_id) const { 313 const views::View* TabStrip::GetViewByID(int view_id) const {
314 if (tab_count() > 0) { 314 if (tab_count() > 0) {
315 if (view_id == VIEW_ID_TAB_LAST) { 315 if (view_id == VIEW_ID_TAB_LAST) {
316 return GetTabAtTabDataIndex(tab_count() - 1); 316 return GetTabAtTabDataIndex(tab_count() - 1);
317 } else if ((view_id >= VIEW_ID_TAB_0) && (view_id < VIEW_ID_TAB_LAST)) { 317 } else if ((view_id >= VIEW_ID_TAB_0) && (view_id < VIEW_ID_TAB_LAST)) {
318 int index = view_id - VIEW_ID_TAB_0; 318 int index = view_id - VIEW_ID_TAB_0;
319 if (index >= 0 && index < tab_count()) { 319 if (index >= 0 && index < tab_count()) {
320 return GetTabAtTabDataIndex(index); 320 return GetTabAtTabDataIndex(index);
321 } else { 321 } else {
322 return NULL; 322 return NULL;
323 } 323 }
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { 949 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const {
950 return last_tab->x() + last_tab->width(); 950 return last_tab->x() + last_tab->width();
951 } 951 }
952 952
953 bool TabStrip::IsPointInTab(Tab* tab, 953 bool TabStrip::IsPointInTab(Tab* tab,
954 const gfx::Point& point_in_tabstrip_coords) { 954 const gfx::Point& point_in_tabstrip_coords) {
955 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); 955 gfx::Point point_in_tab_coords(point_in_tabstrip_coords);
956 View::ConvertPointToView(this, tab, &point_in_tab_coords); 956 View::ConvertPointToView(this, tab, &point_in_tab_coords);
957 return tab->HitTest(point_in_tab_coords); 957 return tab->HitTest(point_in_tab_coords);
958 } 958 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/task_manager_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698