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 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" | 5 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" |
6 | 6 |
7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #import "ios/chrome/browser/ui/toolbar/toolbar_tools_menu_button.h" | 28 #import "ios/chrome/browser/ui/toolbar/toolbar_tools_menu_button.h" |
29 #import "ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.h" | 29 #import "ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.h" |
30 #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" | 30 #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" |
31 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 31 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
32 #import "ios/chrome/common/material_timing.h" | 32 #import "ios/chrome/common/material_timing.h" |
33 #include "ios/chrome/grit/ios_strings.h" | 33 #include "ios/chrome/grit/ios_strings.h" |
34 #include "ios/chrome/grit/ios_theme_resources.h" | 34 #include "ios/chrome/grit/ios_theme_resources.h" |
35 #import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" | 35 #import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" |
36 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" | 36 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" |
37 | 37 |
| 38 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 39 #error "This file requires ARC support." |
| 40 #endif |
| 41 |
38 using base::UserMetricsAction; | 42 using base::UserMetricsAction; |
39 using ios::material::TimingFunction; | 43 using ios::material::TimingFunction; |
40 | 44 |
41 // Animation key used for stack view transition animations | 45 // Animation key used for stack view transition animations |
42 NSString* const kToolbarTransitionAnimationKey = @"ToolbarTransitionAnimation"; | 46 NSString* const kToolbarTransitionAnimationKey = @"ToolbarTransitionAnimation"; |
43 | 47 |
44 // Externed max tab count. | 48 // Externed max tab count. |
45 const NSInteger kStackButtonMaxTabCount = 99; | 49 const NSInteger kStackButtonMaxTabCount = 99; |
46 // Font sizes for the button containing the tab count | 50 // Font sizes for the button containing the tab count |
47 const NSInteger kFontSizeFewerThanTenTabs = 11; | 51 const NSInteger kFontSizeFewerThanTenTabs = 11; |
(...skipping 21 matching lines...) Expand all Loading... |
69 | 73 |
70 // Macros for creating CGRects of height H, origin (0,0), with the portrait | 74 // Macros for creating CGRects of height H, origin (0,0), with the portrait |
71 // width of phone/pad devices. | 75 // width of phone/pad devices. |
72 // clang-format off | 76 // clang-format off |
73 #define IPHONE_FRAME(H) { { 0, 0 }, { kPortraitWidth[IPHONE_IDIOM], H } } | 77 #define IPHONE_FRAME(H) { { 0, 0 }, { kPortraitWidth[IPHONE_IDIOM], H } } |
74 #define IPAD_FRAME(H) { { 0, 0 }, { kPortraitWidth[IPAD_IDIOM], H } } | 78 #define IPAD_FRAME(H) { { 0, 0 }, { kPortraitWidth[IPAD_IDIOM], H } } |
75 | 79 |
76 // Makes a two-element C array of CGRects as described above, one for each | 80 // Makes a two-element C array of CGRects as described above, one for each |
77 // device idiom. | 81 // device idiom. |
78 #define FRAME_PAIR(H) { IPHONE_FRAME(H), IPAD_FRAME(H) } | 82 #define FRAME_PAIR(H) { IPHONE_FRAME(H), IPAD_FRAME(H) } |
79 | |
80 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
81 #error "This file requires ARC support." | |
82 #endif | |
83 // clang-format on | 83 // clang-format on |
84 | 84 |
85 const CGRect kToolbarFrame[INTERFACE_IDIOM_COUNT] = FRAME_PAIR(56); | 85 const CGRect kToolbarFrame[INTERFACE_IDIOM_COUNT] = FRAME_PAIR(56); |
86 | 86 |
87 namespace { | 87 namespace { |
88 | 88 |
89 // Color constants for the stack button text, normal and pressed states. These | 89 // Color constants for the stack button text, normal and pressed states. These |
90 // arrays are indexed by ToolbarControllerStyle enum values. | 90 // arrays are indexed by ToolbarControllerStyle enum values. |
91 const CGFloat kStackButtonNormalColors[] = { | 91 const CGFloat kStackButtonNormalColors[] = { |
92 85.0 / 255.0, // ToolbarControllerStyleLightMode | 92 85.0 / 255.0, // ToolbarControllerStyleLightMode |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 #pragma mark - | 1033 #pragma mark - |
1034 #pragma mark PopupMenuDelegate methods. | 1034 #pragma mark PopupMenuDelegate methods. |
1035 | 1035 |
1036 - (void)dismissPopupMenu:(PopupMenuController*)controller { | 1036 - (void)dismissPopupMenu:(PopupMenuController*)controller { |
1037 if ([controller isKindOfClass:[ToolsPopupController class]] && | 1037 if ([controller isKindOfClass:[ToolsPopupController class]] && |
1038 (ToolsPopupController*)controller == toolsPopupController_) | 1038 (ToolsPopupController*)controller == toolsPopupController_) |
1039 [self dismissToolsMenuPopup]; | 1039 [self dismissToolsMenuPopup]; |
1040 } | 1040 } |
1041 | 1041 |
1042 @end | 1042 @end |
OLD | NEW |