Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h

Issue 2714813002: [iOS] Add Request Mobile Site cell to tools menu (Closed)
Patch Set: Kurt's comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 @interface ToolsMenuViewController : UIViewController 49 @interface ToolsMenuViewController : UIViewController
50 // Keeps track of the state (Bookmarked or not) of the current visible page. 50 // Keeps track of the state (Bookmarked or not) of the current visible page.
51 // This is used to alter the state of the popup menu (i.e. Add/Edit bookmark). 51 // This is used to alter the state of the popup menu (i.e. Add/Edit bookmark).
52 @property(nonatomic, assign) BOOL isCurrentPageBookmarked; 52 @property(nonatomic, assign) BOOL isCurrentPageBookmarked;
53 @property(nonatomic, assign) BOOL isTabLoading; 53 @property(nonatomic, assign) BOOL isTabLoading;
54 // The tool button to be shown hovering above the popup. 54 // The tool button to be shown hovering above the popup.
55 @property(nonatomic, readonly) UIButton* toolsButton; 55 @property(nonatomic, readonly) UIButton* toolsButton;
56 56
57 @property(nonatomic, assign) id<ToolsPopupTableDelegate> delegate; 57 @property(nonatomic, assign) id<ToolsPopupTableDelegate> delegate;
58 58
59 // The user agent type used to load the current page, which also decides the
60 // visibility and enability of "Request Desktop Site" and "Request Mobile Site"
61 // cells in the tools popup menu.
62 @property(nonatomic, assign) web::UserAgentType userAgentType;
63
59 // Initializes the Tools popup menu. 64 // Initializes the Tools popup menu.
60 - (void)initializeMenu:(ToolsMenuContext*)context; 65 - (void)initializeMenu:(ToolsMenuContext*)context;
61 66
62 // Returns the optimal height needed to display the menu items. 67 // Returns the optimal height needed to display the menu items.
63 // The height returned is usually less than the |suggestedHeight| unless 68 // The height returned is usually less than the |suggestedHeight| unless
64 // the last row of the menu puts the height just over the |suggestedHeight|. 69 // 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 70 // 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 71 // one menu item, the last visible menu item will be shown partially so user
67 // can tell that the Tools menu is scrollable. 72 // can tell that the Tools menu is scrollable.
68 - (CGFloat)optimalHeight:(CGFloat)suggestedHeight; 73 - (CGFloat)optimalHeight:(CGFloat)suggestedHeight;
69 74
70 // Enable or disable menu item by IDC value. 75 // Enable or disable menu item by IDC value.
71 - (void)setItemEnabled:(BOOL)enabled withTag:(NSInteger)tag; 76 - (void)setItemEnabled:(BOOL)enabled withTag:(NSInteger)tag;
72 77
73 // Called when the current tab loading state changes. 78 // Called when the current tab loading state changes.
74 - (void)setIsTabLoading:(BOOL)isTabLoading; 79 - (void)setIsTabLoading:(BOOL)isTabLoading;
75 80
81 // Called when the current tab user agent type changes.
82 - (void)setUserAgentType:(web::UserAgentType)type;
kkhorimoto 2017/02/27 23:44:24 This isn't necessary since it's automatically crea
liaoyuke 2017/02/28 02:01:00 Done.
83
76 // TODO(stuartmorgan): Should the set of options that are passed in to the 84 // 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 85 // constructor just have the ability to specify whether commands should be
78 // enabled or disabled rather than having these individual setters? crbug/228506 86 // enabled or disabled rather than having these individual setters? crbug/228506
79 // Informs tools popup menu whether "Find In Page..." command should be 87 // Informs tools popup menu whether "Find In Page..." command should be
80 // enabled. 88 // enabled.
81 - (void)setCanShowFindBar:(BOOL)enabled; 89 - (void)setCanShowFindBar:(BOOL)enabled;
82 90
83 // Informs tools popup menu whether "Share..." command should be enabled. 91 // Informs tools popup menu whether "Share..." command should be enabled.
84 - (void)setCanShowShareMenu:(BOOL)enabled; 92 - (void)setCanShowShareMenu:(BOOL)enabled;
85 93
86 // Informs tools popup menu whether the switch to reader mode is possible. 94 // Informs tools popup menu whether the switch to reader mode is possible.
87 - (void)setCanUseReaderMode:(BOOL)enabled; 95 - (void)setCanUseReaderMode:(BOOL)enabled;
88 96
89 // Informs tools popup menu whether "Request Desktop Site" can be enabled.
90 - (void)setCanUseDesktopUserAgent:(BOOL)value;
91
92 - (void)animateContentIn; 97 - (void)animateContentIn;
93 98
94 - (void)hideContent; 99 - (void)hideContent;
95 100
96 @end 101 @end
97 102
98 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_VIEW_CONTROLLER_H_ 103 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_VIEW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698