| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/i18n/number_formatting.h" | 9 #include "base/i18n/number_formatting.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 next_element_x = origin_chip_view_->bounds().right() + kStandardSpacing; | 674 next_element_x = origin_chip_view_->bounds().right() + kStandardSpacing; |
| 675 } | 675 } |
| 676 | 676 |
| 677 // Extend the app menu to the screen's right edge in maximized mode just like | 677 // Extend the app menu to the screen's right edge in maximized mode just like |
| 678 // we extend the back button to the left edge. | 678 // we extend the back button to the left edge. |
| 679 if (maximized) | 679 if (maximized) |
| 680 app_menu_width += kRightEdgeSpacing; | 680 app_menu_width += kRightEdgeSpacing; |
| 681 app_menu_->SetBounds(next_element_x, child_y, app_menu_width, child_height); | 681 app_menu_->SetBounds(next_element_x, child_y, app_menu_width, child_height); |
| 682 } | 682 } |
| 683 | 683 |
| 684 bool ToolbarView::HitTestRect(const gfx::Rect& rect) const { | 684 bool ToolbarView::HitTestRect(const gfx::RectF& rect) const { |
| 685 // Fall through to the tab strip above us if none of |rect| intersects | 685 // Fall through to the tab strip above us if none of |rect| intersects |
| 686 // with this view (intersection with the top shadow edge does not | 686 // with this view (intersection with the top shadow edge does not |
| 687 // count as intersection with this view). | 687 // count as intersection with this view). |
| 688 if (rect.bottom() < content_shadow_height()) | 688 if (rect.bottom() < content_shadow_height()) |
| 689 return false; | 689 return false; |
| 690 // Otherwise let our superclass take care of it. | 690 // Otherwise let our superclass take care of it. |
| 691 return AccessiblePaneView::HitTestRect(rect); | 691 return AccessiblePaneView::HitTestRect(rect); |
| 692 } | 692 } |
| 693 | 693 |
| 694 void ToolbarView::OnPaint(gfx::Canvas* canvas) { | 694 void ToolbarView::OnPaint(gfx::Canvas* canvas) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 | 874 |
| 875 void ToolbarView::OnShowHomeButtonChanged() { | 875 void ToolbarView::OnShowHomeButtonChanged() { |
| 876 Layout(); | 876 Layout(); |
| 877 SchedulePaint(); | 877 SchedulePaint(); |
| 878 } | 878 } |
| 879 | 879 |
| 880 int ToolbarView::content_shadow_height() const { | 880 int ToolbarView::content_shadow_height() const { |
| 881 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 881 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
| 882 kContentShadowHeightAsh : kContentShadowHeight; | 882 kContentShadowHeightAsh : kContentShadowHeight; |
| 883 } | 883 } |
| OLD | NEW |