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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
78 #include "chrome/browser/recovery/recovery_install_global_error_factory.h" | 78 #include "chrome/browser/recovery/recovery_install_global_error_factory.h" |
79 #include "chrome/browser/ui/views/conflicting_module_view_win.h" | 79 #include "chrome/browser/ui/views/conflicting_module_view_win.h" |
80 #include "chrome/browser/ui/views/critical_notification_bubble_view.h" | 80 #include "chrome/browser/ui/views/critical_notification_bubble_view.h" |
81 #endif | 81 #endif |
82 | 82 |
83 #if !defined(OS_CHROMEOS) | 83 #if !defined(OS_CHROMEOS) |
84 #include "chrome/browser/signin/signin_global_error_factory.h" | 84 #include "chrome/browser/signin/signin_global_error_factory.h" |
85 #include "chrome/browser/sync/sync_global_error_factory.h" | 85 #include "chrome/browser/sync/sync_global_error_factory.h" |
| 86 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
86 #endif | 87 #endif |
87 | 88 |
88 #if defined(USE_ASH) | 89 #if defined(USE_ASH) |
89 #include "ash/shell.h" | 90 #include "ash/shell.h" |
90 #endif | 91 #endif |
91 | 92 |
92 using base::UserMetricsAction; | 93 using base::UserMetricsAction; |
93 using content::WebContents; | 94 using content::WebContents; |
94 | 95 |
95 namespace { | 96 namespace { |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 #if defined(OS_WIN) | 693 #if defined(OS_WIN) |
693 ConflictingModuleView::MaybeShow(browser_, app_menu_button_); | 694 ConflictingModuleView::MaybeShow(browser_, app_menu_button_); |
694 #endif | 695 #endif |
695 } | 696 } |
696 incompatibility_badge_showing = true; | 697 incompatibility_badge_showing = true; |
697 return; | 698 return; |
698 } | 699 } |
699 } | 700 } |
700 | 701 |
701 int ToolbarView::PopupTopSpacing() const { | 702 int ToolbarView::PopupTopSpacing() const { |
702 const int kAdditionalPopupTopSpacingNonGlass = 2; | 703 #if defined(OS_CHROMEOS) |
| 704 return views::NonClientFrameView::kClientEdgeThickness; |
| 705 #else |
703 return views::NonClientFrameView::kClientEdgeThickness + | 706 return views::NonClientFrameView::kClientEdgeThickness + |
704 (GetWidget()->ShouldWindowContentsBeTransparent() ? | 707 (GetWidget()->ShouldWindowContentsBeTransparent() ? |
705 0 : kAdditionalPopupTopSpacingNonGlass); | 708 0 : OpaqueBrowserFrameView::kContentEdgeShadowThickness); |
| 709 #endif |
706 } | 710 } |
707 | 711 |
708 gfx::Size ToolbarView::GetSizeInternal( | 712 gfx::Size ToolbarView::GetSizeInternal( |
709 gfx::Size (View::*get_size)() const) const { | 713 gfx::Size (View::*get_size)() const) const { |
710 gfx::Size size((location_bar_->*get_size)()); | 714 gfx::Size size((location_bar_->*get_size)()); |
711 if (is_display_mode_normal()) { | 715 if (is_display_mode_normal()) { |
712 const int element_padding = GetLayoutConstant(TOOLBAR_ELEMENT_PADDING); | 716 const int element_padding = GetLayoutConstant(TOOLBAR_ELEMENT_PADDING); |
713 const int browser_actions_width = | 717 const int browser_actions_width = |
714 (browser_actions_->*get_size)().width(); | 718 (browser_actions_->*get_size)().width(); |
715 const int right_padding = | 719 const int right_padding = |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 void ToolbarView::OnShowHomeButtonChanged() { | 826 void ToolbarView::OnShowHomeButtonChanged() { |
823 Layout(); | 827 Layout(); |
824 SchedulePaint(); | 828 SchedulePaint(); |
825 } | 829 } |
826 | 830 |
827 int ToolbarView::content_shadow_height() const { | 831 int ToolbarView::content_shadow_height() const { |
828 return GetLayoutConstant( | 832 return GetLayoutConstant( |
829 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? | 833 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? |
830 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); | 834 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); |
831 } | 835 } |
OLD | NEW |