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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 // we extend the back button to the left edge. | 568 // we extend the back button to the left edge. |
569 if (maximized) | 569 if (maximized) |
570 app_menu_width += kRightEdgeSpacing; | 570 app_menu_width += kRightEdgeSpacing; |
571 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y, | 571 app_menu_->SetBounds(browser_actions_->x() + browser_actions_width, child_y, |
572 app_menu_width, child_height); | 572 app_menu_width, child_height); |
573 } | 573 } |
574 | 574 |
575 bool ToolbarView::HitTestRect(const gfx::Rect& rect) const { | 575 bool ToolbarView::HitTestRect(const gfx::Rect& rect) const { |
576 // Don't take hits in our top shadow edge. Let them fall through to the | 576 // Don't take hits in our top shadow edge. Let them fall through to the |
577 // tab strip above us. | 577 // tab strip above us. |
578 if (rect.y() < content_shadow_height()) | 578 if (rect.bottom() < content_shadow_height()) |
579 return false; | 579 return false; |
580 // Otherwise let our superclass take care of it. | 580 // Otherwise let our superclass take care of it. |
581 return AccessiblePaneView::HitTestRect(rect); | 581 return AccessiblePaneView::HitTestRect(rect); |
582 } | 582 } |
583 | 583 |
584 void ToolbarView::OnPaint(gfx::Canvas* canvas) { | 584 void ToolbarView::OnPaint(gfx::Canvas* canvas) { |
585 View::OnPaint(canvas); | 585 View::OnPaint(canvas); |
586 | 586 |
587 if (is_display_mode_normal()) | 587 if (is_display_mode_normal()) |
588 return; | 588 return; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 | 793 |
794 void ToolbarView::OnShowHomeButtonChanged() { | 794 void ToolbarView::OnShowHomeButtonChanged() { |
795 Layout(); | 795 Layout(); |
796 SchedulePaint(); | 796 SchedulePaint(); |
797 } | 797 } |
798 | 798 |
799 int ToolbarView::content_shadow_height() const { | 799 int ToolbarView::content_shadow_height() const { |
800 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 800 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
801 kContentShadowHeightAsh : kContentShadowHeight; | 801 kContentShadowHeightAsh : kContentShadowHeight; |
802 } | 802 } |
OLD | NEW |