Chromium Code Reviews| 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 #ifndef IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_POPUP_CONTROLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_POPUP_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_POPUP_CONTROLLER_H_ | 6 #define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_POPUP_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #import "ios/chrome/browser/ui/popup_menu/popup_menu_controller.h" | 10 #import "ios/chrome/browser/ui/popup_menu/popup_menu_controller.h" |
| 11 | 11 |
| 12 // The a11y ID of the tools menu table view (used by integration tests). | 12 // The a11y ID of the tools menu table view (used by integration tests). |
| 13 extern NSString* const kToolsMenuTableViewId; | 13 extern NSString* const kToolsMenuTableViewId; |
| 14 | 14 |
| 15 @class ToolsMenuContext; | 15 @class ToolsMenuContext; |
| 16 | 16 |
| 17 // The view controller for the tools menu within the top toolbar. | 17 // The view controller for the tools menu within the top toolbar. |
| 18 // The menu is composed of two main view: a top view with icons and a bottom | 18 // The menu is composed of two main view: a top view with icons and a bottom |
| 19 // view with a table view of menu items. | 19 // view with a table view of menu items. |
| 20 @interface ToolsPopupController : PopupMenuController | 20 @interface ToolsPopupController : PopupMenuController |
| 21 | 21 |
| 22 @property(nonatomic, assign) BOOL isCurrentPageBookmarked; | 22 @property(nonatomic, assign) BOOL isCurrentPageBookmarked; |
| 23 | 23 |
| 24 // The user agent type used to load the current page, which also decides the | |
| 25 // visibility and enability of "Request Desktop Site" and "Request Mobile Site" | |
| 26 // cells in the tools popup menu. | |
| 27 @property(nonatomic, assign) BOOL userAgentType; | |
| 28 | |
| 24 // Initializes the popup with the given |context|, a set of information used to | 29 // Initializes the popup with the given |context|, a set of information used to |
| 25 // determine the appearance of the menu and the entries displayed. | 30 // determine the appearance of the menu and the entries displayed. |
| 26 - (instancetype)initWithContext:(ToolsMenuContext*)context; | 31 - (instancetype)initWithContext:(ToolsMenuContext*)context; |
| 27 | 32 |
| 28 // Called when the current tab loading state changes. | 33 // Called when the current tab loading state changes. |
| 29 - (void)setIsTabLoading:(BOOL)isTabLoading; | 34 - (void)setIsTabLoading:(BOOL)isTabLoading; |
| 30 | 35 |
| 36 // Called when the current tab user agent type changes. | |
| 37 - (void)setUserAgentType:(web::UserAgentType)type; | |
|
kkhorimoto
2017/02/27 23:44:24
This isn't necessary since it's created by your pr
liaoyuke
2017/02/28 02:01:01
Done.
| |
| 38 | |
| 31 // TODO(stuartmorgan): Should the set of options that are passed in to the | 39 // TODO(stuartmorgan): Should the set of options that are passed in to the |
| 32 // constructor just have the ability to specify whether commands should be | 40 // constructor just have the ability to specify whether commands should be |
| 33 // enabled or disabled rather than having these individual setters? b/6048639 | 41 // enabled or disabled rather than having these individual setters? b/6048639 |
| 34 // Informs tools popup menu whether "Find In Page..." command should be | 42 // Informs tools popup menu whether "Find In Page..." command should be |
| 35 // enabled. | 43 // enabled. |
| 36 - (void)setCanShowFindBar:(BOOL)enabled; | 44 - (void)setCanShowFindBar:(BOOL)enabled; |
| 37 | 45 |
| 38 // Informs tools popup menu whether "Share..." command should be enabled. | 46 // Informs tools popup menu whether "Share..." command should be enabled. |
| 39 - (void)setCanShowShareMenu:(BOOL)enabled; | 47 - (void)setCanShowShareMenu:(BOOL)enabled; |
| 40 | 48 |
| 41 // Informs tools popup menu whether the switch to reader mode is possible. | 49 // Informs tools popup menu whether the switch to reader mode is possible. |
| 42 - (void)setCanUseReaderMode:(BOOL)enabled; | 50 - (void)setCanUseReaderMode:(BOOL)enabled; |
| 43 | 51 |
| 44 // Informs tools popup menu whether "Request Desktop Site" can be enabled. | |
| 45 - (void)setCanUseDesktopUserAgent:(BOOL)value; | |
| 46 | |
| 47 @end | 52 @end |
| 48 | 53 |
| 49 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_POPUP_CONTROLLER_H_ | 54 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_POPUP_CONTROLLER_H_ |
| OLD | NEW |