Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MENU_VIEW_CONTROLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_VIEW_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_VIEW_CONTROLLER_H_ | 6 #define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 @class ToolsMenuContext; | 10 @class ToolsMenuContext; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 - (void)initializeMenu:(ToolsMenuContext*)context; | 60 - (void)initializeMenu:(ToolsMenuContext*)context; |
| 61 | 61 |
| 62 // Returns the optimal height needed to display the menu items. | 62 // Returns the optimal height needed to display the menu items. |
| 63 // The height returned is usually less than the |suggestedHeight| unless | 63 // The height returned is usually less than the |suggestedHeight| unless |
| 64 // the last row of the menu puts the height just over the |suggestedHeight|. | 64 // the last row of the menu puts the height just over the |suggestedHeight|. |
| 65 // If the Tools menu items is taller than the |suggestedHeight| by at least | 65 // If the Tools menu items is taller than the |suggestedHeight| by at least |
| 66 // one menu item, the last visible menu item will be shown partially so user | 66 // one menu item, the last visible menu item will be shown partially so user |
| 67 // can tell that the Tools menu is scrollable. | 67 // can tell that the Tools menu is scrollable. |
| 68 - (CGFloat)optimalHeight:(CGFloat)suggestedHeight; | 68 - (CGFloat)optimalHeight:(CGFloat)suggestedHeight; |
| 69 | 69 |
| 70 // Hide a menu item by IDC value. | |
| 71 - (void)hideItemWithTag:(NSInteger)tag; | |
|
kkhorimoto
2017/02/25 02:36:32
This is only used from tools_menu_view_controller.
liaoyuke
2017/02/27 17:34:22
Acknowledged.
liaoyuke
2017/02/27 21:48:59
Done.
| |
| 72 | |
| 70 // Enable or disable menu item by IDC value. | 73 // Enable or disable menu item by IDC value. |
| 71 - (void)setItemEnabled:(BOOL)enabled withTag:(NSInteger)tag; | 74 - (void)setItemEnabled:(BOOL)enabled withTag:(NSInteger)tag; |
| 72 | 75 |
| 73 // Called when the current tab loading state changes. | 76 // Called when the current tab loading state changes. |
| 74 - (void)setIsTabLoading:(BOOL)isTabLoading; | 77 - (void)setIsTabLoading:(BOOL)isTabLoading; |
| 75 | 78 |
| 79 // Informs tools popup menu to hide "Request Desktop Site" or | |
| 80 // "Request Mobile Site", note that only one of them is expected to be called | |
| 81 // at any time. | |
| 82 - (void)hideRequestDesktopSite; | |
| 83 - (void)hideRequestMobileSite; | |
|
kkhorimoto
2017/02/25 02:36:33
As noted below, let's remove these functions and d
liaoyuke
2017/02/27 17:34:22
Acknowledged.
liaoyuke
2017/02/27 21:48:59
Done.
| |
| 84 | |
| 76 // TODO(stuartmorgan): Should the set of options that are passed in to the | 85 // TODO(stuartmorgan): Should the set of options that are passed in to the |
| 77 // constructor just have the ability to specify whether commands should be | 86 // constructor just have the ability to specify whether commands should be |
| 78 // enabled or disabled rather than having these individual setters? crbug/228506 | 87 // enabled or disabled rather than having these individual setters? crbug/228506 |
| 79 // Informs tools popup menu whether "Find In Page..." command should be | 88 // Informs tools popup menu whether "Find In Page..." command should be |
| 80 // enabled. | 89 // enabled. |
| 81 - (void)setCanShowFindBar:(BOOL)enabled; | 90 - (void)setCanShowFindBar:(BOOL)enabled; |
| 82 | 91 |
| 83 // Informs tools popup menu whether "Share..." command should be enabled. | 92 // Informs tools popup menu whether "Share..." command should be enabled. |
| 84 - (void)setCanShowShareMenu:(BOOL)enabled; | 93 - (void)setCanShowShareMenu:(BOOL)enabled; |
| 85 | 94 |
| 86 // Informs tools popup menu whether the switch to reader mode is possible. | 95 // Informs tools popup menu whether the switch to reader mode is possible. |
| 87 - (void)setCanUseReaderMode:(BOOL)enabled; | 96 - (void)setCanUseReaderMode:(BOOL)enabled; |
| 88 | 97 |
| 89 // Informs tools popup menu whether "Request Desktop Site" can be enabled. | 98 // Informs tools popup menu whether "Request Desktop Site" can be enabled. |
| 90 - (void)setCanUseDesktopUserAgent:(BOOL)value; | 99 - (void)setCanUseDesktopUserAgent:(BOOL)value; |
| 91 | 100 |
| 101 // Informs tools popup menu whether "Request Mobile Site" can be enabled. | |
| 102 - (void)setCanUseMobileUserAgent:(BOOL)value; | |
|
kkhorimoto
2017/02/25 02:36:33
Instead of this and the above function, let's just
liaoyuke
2017/02/27 17:34:22
My only concern is that we might be creating unnec
liaoyuke
2017/02/27 21:48:59
Done.
kkhorimoto
2017/02/27 23:44:23
As mentioned in my other comment, because UserAgen
| |
| 103 | |
| 92 - (void)animateContentIn; | 104 - (void)animateContentIn; |
| 93 | 105 |
| 94 - (void)hideContent; | 106 - (void)hideContent; |
| 95 | 107 |
| 96 @end | 108 @end |
| 97 | 109 |
| 98 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_VIEW_CONTROLLER_H_ | 110 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_VIEW_CONTROLLER_H_ |
| OLD | NEW |