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

Side by Side Diff: chrome/browser/ui/views/toolbar_view.cc

Issue 10082029: Ash: Fix hit testing for the bottom pixels of tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/toolbar_view.h ('k') | ui/views/view.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/toolbar_view.h" 5 #include "chrome/browser/ui/views/toolbar_view.h"
6 6
7 #include "base/i18n/number_formatting.h" 7 #include "base/i18n/number_formatting.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 browser_actions_->Layout(); 598 browser_actions_->Layout();
599 599
600 // Extend the app menu to the screen's right edge in maximized mode just like 600 // Extend the app menu to the screen's right edge in maximized mode just like
601 // we extend the back button to the left edge. 601 // we extend the back button to the left edge.
602 if (maximized) 602 if (maximized)
603 app_menu_width += kRightEdgeSpacing; 603 app_menu_width += kRightEdgeSpacing;
604 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y, 604 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y,
605 app_menu_width, child_height); 605 app_menu_width, child_height);
606 } 606 }
607 607
608 bool ToolbarView::HitTest(const gfx::Point& l) const {
609 // Don't take hits in our top shadow edge. Let them fall through to the
610 // tab strip above us.
611 if (l.y() < kContentShadowHeight)
612 return false;
613 // Otherwise let our superclass take care of it.
614 return AccessiblePaneView::HitTest(l);
615 }
616
608 void ToolbarView::OnPaint(gfx::Canvas* canvas) { 617 void ToolbarView::OnPaint(gfx::Canvas* canvas) {
609 View::OnPaint(canvas); 618 View::OnPaint(canvas);
610 619
611 if (IsDisplayModeNormal()) 620 if (IsDisplayModeNormal())
612 return; 621 return;
613 622
614 // In maximized mode, we don't draw the endcaps on the location bar, because 623 // In maximized mode, we don't draw the endcaps on the location bar, because
615 // when they're flush against the edge of the screen they just look glitchy. 624 // when they're flush against the edge of the screen they just look glitchy.
616 if (!browser_->window() || !browser_->window()->IsMaximized()) { 625 if (!browser_->window() || !browser_->window()->IsMaximized()) {
617 int top_spacing = PopupTopSpacing(); 626 int top_spacing = PopupTopSpacing();
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 accname_app = l10n_util::GetStringFUTF16( 784 accname_app = l10n_util::GetStringFUTF16(
776 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); 785 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app);
777 } 786 }
778 app_menu_->SetAccessibleName(accname_app); 787 app_menu_->SetAccessibleName(accname_app);
779 788
780 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); 789 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL));
781 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); 790 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT));
782 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); 791 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED));
783 SchedulePaint(); 792 SchedulePaint();
784 } 793 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.h ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698