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

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

Issue 7057014: Variety of tweaks to View API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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.cc ('k') | chrome/browser/ui/views/toolbar_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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 526
527 void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) { 527 void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) {
528 if (sender == newtab_button_) 528 if (sender == newtab_button_)
529 controller()->CreateNewTab(); 529 controller()->CreateNewTab();
530 } 530 }
531 531
532 /////////////////////////////////////////////////////////////////////////////// 532 ///////////////////////////////////////////////////////////////////////////////
533 // TabStrip, private: 533 // TabStrip, private:
534 534
535 void TabStrip::Init() { 535 void TabStrip::Init() {
536 SetID(VIEW_ID_TAB_STRIP); 536 set_id(VIEW_ID_TAB_STRIP);
537 newtab_button_bounds_.SetRect(0, 0, kNewTabButtonWidth, kNewTabButtonHeight); 537 newtab_button_bounds_.SetRect(0, 0, kNewTabButtonWidth, kNewTabButtonHeight);
538 if (browser_defaults::kSizeTabButtonToTopOfTabStrip) { 538 if (browser_defaults::kSizeTabButtonToTopOfTabStrip) {
539 newtab_button_bounds_.set_height( 539 newtab_button_bounds_.set_height(
540 kNewTabButtonHeight + kNewTabButtonVOffset); 540 kNewTabButtonHeight + kNewTabButtonVOffset);
541 } 541 }
542 if (drop_indicator_width == 0) { 542 if (drop_indicator_width == 0) {
543 // Direction doesn't matter, both images are the same size. 543 // Direction doesn't matter, both images are the same size.
544 SkBitmap* drop_image = GetDropArrowImage(true); 544 SkBitmap* drop_image = GetDropArrowImage(true);
545 drop_indicator_width = drop_image->width(); 545 drop_indicator_width = drop_image->width();
546 drop_indicator_height = drop_image->height(); 546 drop_indicator_height = drop_image->height();
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { 999 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const {
1000 return last_tab->x() + last_tab->width(); 1000 return last_tab->x() + last_tab->width();
1001 } 1001 }
1002 1002
1003 bool TabStrip::IsPointInTab(Tab* tab, 1003 bool TabStrip::IsPointInTab(Tab* tab,
1004 const gfx::Point& point_in_tabstrip_coords) { 1004 const gfx::Point& point_in_tabstrip_coords) {
1005 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); 1005 gfx::Point point_in_tab_coords(point_in_tabstrip_coords);
1006 View::ConvertPointToView(this, tab, &point_in_tab_coords); 1006 View::ConvertPointToView(this, tab, &point_in_tab_coords);
1007 return tab->HitTest(point_in_tab_coords); 1007 return tab->HitTest(point_in_tab_coords);
1008 } 1008 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698