OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/i18n/number_formatting.h" | 8 #include "base/i18n/number_formatting.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 // we extend the back button to the left edge. | 560 // we extend the back button to the left edge. |
561 if (maximized) | 561 if (maximized) |
562 app_menu_width += kRightEdgeSpacing; | 562 app_menu_width += kRightEdgeSpacing; |
563 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y, | 563 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y, |
564 app_menu_width, child_height); | 564 app_menu_width, child_height); |
565 } | 565 } |
566 | 566 |
567 bool ToolbarView::HitTestRect(const gfx::Rect& rect) const { | 567 bool ToolbarView::HitTestRect(const gfx::Rect& rect) const { |
568 // Don't take hits in our top shadow edge. Let them fall through to the | 568 // Don't take hits in our top shadow edge. Let them fall through to the |
569 // tab strip above us. | 569 // tab strip above us. |
570 if (rect.y() < content_shadow_height()) | 570 if (rect.bottom() < content_shadow_height()) |
571 return false; | 571 return false; |
572 // Otherwise let our superclass take care of it. | 572 // Otherwise let our superclass take care of it. |
573 return AccessiblePaneView::HitTestRect(rect); | 573 return AccessiblePaneView::HitTestRect(rect); |
574 } | 574 } |
575 | 575 |
576 void ToolbarView::OnPaint(gfx::Canvas* canvas) { | 576 void ToolbarView::OnPaint(gfx::Canvas* canvas) { |
577 View::OnPaint(canvas); | 577 View::OnPaint(canvas); |
578 | 578 |
579 if (is_display_mode_normal()) | 579 if (is_display_mode_normal()) |
580 return; | 580 return; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 | 785 |
786 void ToolbarView::OnShowHomeButtonChanged() { | 786 void ToolbarView::OnShowHomeButtonChanged() { |
787 Layout(); | 787 Layout(); |
788 SchedulePaint(); | 788 SchedulePaint(); |
789 } | 789 } |
790 | 790 |
791 int ToolbarView::content_shadow_height() const { | 791 int ToolbarView::content_shadow_height() const { |
792 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 792 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
793 kContentShadowHeightAsh : kContentShadowHeight; | 793 kContentShadowHeightAsh : kContentShadowHeight; |
794 } | 794 } |
OLD | NEW |