OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "ios/chrome/browser/ui/tools_menu/tools_menu_model.h" | 5 #include "ios/chrome/browser/ui/tools_menu/tools_menu_model.h" |
6 | 6 |
7 #include "components/strings/grit/components_strings.h" | 7 #include "components/strings/grit/components_strings.h" |
8 #include "ios/chrome/browser/experimental_flags.h" | 8 #include "ios/chrome/browser/experimental_flags.h" |
9 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" | 9 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" |
10 #import "ios/chrome/browser/ui/tools_menu/reading_list_menu_view_item.h" | 10 #import "ios/chrome/browser/ui/tools_menu/reading_list_menu_view_item.h" |
11 #include "ios/chrome/browser/ui/tools_menu/tools_menu_constants.h" | 11 #include "ios/chrome/browser/ui/tools_menu/tools_menu_constants.h" |
12 #include "ios/chrome/browser/ui/ui_util.h" | 12 #include "ios/chrome/browser/ui/ui_util.h" |
13 #include "ios/chrome/grit/ios_strings.h" | 13 #include "ios/chrome/grit/ios_strings.h" |
14 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 14 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
15 #import "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider
.h" | 15 #import "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider
.h" |
16 #include "ios/web/public/user_agent.h" | 16 #include "ios/web/public/user_agent.h" |
17 | 17 |
| 18 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 19 #error "This file requires ARC support." |
| 20 #endif |
| 21 |
18 // Menu items can be marked as visible or not when Incognito is enabled. | 22 // Menu items can be marked as visible or not when Incognito is enabled. |
19 // The following bits are used for |visibility| field in |MenuItemInfo|. | 23 // The following bits are used for |visibility| field in |MenuItemInfo|. |
20 const NSInteger kVisibleIncognitoOnly = 1 << 0; | 24 const NSInteger kVisibleIncognitoOnly = 1 << 0; |
21 const NSInteger kVisibleNotIncognitoOnly = 1 << 1; | 25 const NSInteger kVisibleNotIncognitoOnly = 1 << 1; |
22 | 26 |
23 // Declare all the possible items. | 27 // Declare all the possible items. |
24 const MenuItemInfo itemInfoList[] = { | 28 const MenuItemInfo itemInfoList[] = { |
25 // clang-format off | 29 // clang-format off |
26 { IDS_IOS_TOOLS_MENU_NEW_TAB, kToolsMenuNewTabId, | 30 { IDS_IOS_TOOLS_MENU_NEW_TAB, kToolsMenuNewTabId, |
27 IDC_NEW_TAB, ToolbarTypeAll, | 31 IDC_NEW_TAB, ToolbarTypeAll, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return true; | 109 return true; |
106 case IDS_IOS_TOOLS_MENU_REQUEST_MOBILE_SITE: | 110 case IDS_IOS_TOOLS_MENU_REQUEST_MOBILE_SITE: |
107 if (experimental_flags::IsRequestMobileSiteEnabled()) | 111 if (experimental_flags::IsRequestMobileSiteEnabled()) |
108 return (configuration.userAgentType == web::UserAgentType::DESKTOP); | 112 return (configuration.userAgentType == web::UserAgentType::DESKTOP); |
109 else | 113 else |
110 return false; | 114 return false; |
111 default: | 115 default: |
112 return true; | 116 return true; |
113 } | 117 } |
114 } | 118 } |
OLD | NEW |