OLD | NEW |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "chrome/browser/ui/views/app_menu_button_win.h" | 48 #include "chrome/browser/ui/views/app_menu_button_win.h" |
49 #endif | 49 #endif |
50 #endif | 50 #endif |
51 | 51 |
52 using content::UserMetricsAction; | 52 using content::UserMetricsAction; |
53 using content::WebContents; | 53 using content::WebContents; |
54 | 54 |
55 // static | 55 // static |
56 const char ToolbarView::kViewClassName[] = "browser/ui/views/ToolbarView"; | 56 const char ToolbarView::kViewClassName[] = "browser/ui/views/ToolbarView"; |
57 // The space between items is 4 px in general. | 57 // The space between items is 4 px in general. |
| 58 // TODO(jamescook): Update all Chrome platforms to use the new art and metrics |
| 59 // from Ash, crbug.com/118228 |
| 60 #if defined(USE_ASH) |
| 61 const int ToolbarView::kStandardSpacing = 3; |
| 62 #else |
58 const int ToolbarView::kStandardSpacing = 4; | 63 const int ToolbarView::kStandardSpacing = 4; |
| 64 #endif |
| 65 |
59 // The top of the toolbar has an edge we have to skip over in addition to the 4 | 66 // The top of the toolbar has an edge we have to skip over in addition to the 4 |
60 // px of spacing. | 67 // px of spacing. |
61 const int ToolbarView::kVertSpacing = kStandardSpacing + 1; | 68 const int ToolbarView::kVertSpacing = 5; |
62 // The edge graphics have some built-in spacing/shadowing, so we have to adjust | 69 // The edge graphics have some built-in spacing/shadowing, so we have to adjust |
63 // our spacing to make it still appear to be 4 px. | 70 // our spacing to make it still appear to be 4 px. |
64 static const int kEdgeSpacing = ToolbarView::kStandardSpacing - 1; | 71 #if defined(USE_ASH) |
| 72 static const int kEdgeSpacing = 4; |
| 73 #else |
| 74 static const int kEdgeSpacing = 3; |
| 75 #endif |
| 76 |
65 // The buttons to the left of the omnibox are close together. | 77 // The buttons to the left of the omnibox are close together. |
| 78 #if defined(USE_ASH) |
| 79 static const int kButtonSpacing = 0; |
| 80 #else |
66 static const int kButtonSpacing = 1; | 81 static const int kButtonSpacing = 1; |
67 | 82 #endif |
68 static const int kStatusBubbleWidth = 480; | |
69 | 83 |
70 // The length of time to run the upgrade notification animation (the time it | 84 // The length of time to run the upgrade notification animation (the time it |
71 // takes one pulse to run its course and go back to its original brightness). | 85 // takes one pulse to run its course and go back to its original brightness). |
72 static const int kPulseDuration = 2000; | 86 static const int kPulseDuration = 2000; |
73 | 87 |
74 // How long to wait between pulsating the upgrade notifier. | 88 // How long to wait between pulsating the upgrade notifier. |
75 static const int kPulsateEveryMs = 8000; | 89 static const int kPulsateEveryMs = 8000; |
76 | 90 |
77 static const int kPopupTopSpacingNonGlass = 3; | 91 static const int kPopupTopSpacingNonGlass = 3; |
78 static const int kPopupBottomSpacingNonGlass = 2; | 92 static const int kPopupBottomSpacingNonGlass = 2; |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 accname_app = l10n_util::GetStringFUTF16( | 746 accname_app = l10n_util::GetStringFUTF16( |
733 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); | 747 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); |
734 } | 748 } |
735 app_menu_->SetAccessibleName(accname_app); | 749 app_menu_->SetAccessibleName(accname_app); |
736 | 750 |
737 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); | 751 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); |
738 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); | 752 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); |
739 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); | 753 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); |
740 SchedulePaint(); | 754 SchedulePaint(); |
741 } | 755 } |
OLD | NEW |