| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONFIGURATION_H_ | |
| 6 #define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONFIGURATION_H_ | |
| 7 | |
| 8 #import <Foundation/Foundation.h> | |
| 9 #import <UIKit/UIKit.h> | |
| 10 | |
| 11 @class ReadingListMenuNotifier; | |
| 12 | |
| 13 namespace web { | |
| 14 enum class UserAgentType : short; | |
| 15 } // namespace web | |
| 16 | |
| 17 // Configuation defining options that can be set to change the tools menu's | |
| 18 // appearance. All boolean properties are set to NO, and |userAgentType| is set | |
| 19 // to NONE by default. | |
| 20 @interface ToolsMenuConfiguration : NSObject | |
| 21 // Indicates that the menu is being shown while in the tab switcher. | |
| 22 @property(nonatomic, getter=isInTabSwitcher) BOOL inTabSwitcher; | |
| 23 // Indicates that the menu is being shown while there are no open tabs. | |
| 24 @property(nonatomic, getter=hasNoOpenedTabs) BOOL noOpenedTabs; | |
| 25 // Indicates that the menu is being shown while in incognito mode. | |
| 26 @property(nonatomic, getter=isInIncognito) BOOL inIncognito; | |
| 27 | |
| 28 // Indicates that the menu is being shown while user agent is |userAgentType|. | |
| 29 // If NONE, shows "Request Desktop Site" in disabled state. | |
| 30 // If MOBILE, shows "Request Desktop Site" in enabled state. | |
| 31 // If DESKTOP, shows "Request Mobile Site" in enabled state. | |
| 32 @property(nonatomic, assign) web::UserAgentType userAgentType; | |
| 33 | |
| 34 // View that the menu will be displayed in. | |
| 35 @property(nonatomic, readonly) UIView* displayView; | |
| 36 // Button from which popup menu will be opened. | |
| 37 @property(nonatomic, assign) UIButton* toolsMenuButton; | |
| 38 // Menu's origin relative to the |displayView|'s coordinate system, calculated | |
| 39 // from |toolsMenuButton| and |displayView|. | |
| 40 @property(nonatomic, readonly) CGRect sourceRect; | |
| 41 // Image insets that should be applied to the tools button if it is displayed, | |
| 42 // calculated from |toolsMenuButton|. | |
| 43 @property(nonatomic, readonly) UIEdgeInsets toolsButtonInsets; | |
| 44 // Notifier for changes to the reading list requiring the menu to be updated. | |
| 45 // Menus needing to be updated should set themselves as this object's delegate. | |
| 46 @property(nonatomic, assign) ReadingListMenuNotifier* readingListMenuNotifier; | |
| 47 | |
| 48 // Initialize a ToolsMenuContext instance with default values. |displayView| is | |
| 49 // the weakly-held parent view within which the popup tools menu using this | |
| 50 // context will be displayed. | |
| 51 - (instancetype)initWithDisplayView:(UIView*)displayView | |
| 52 NS_DESIGNATED_INITIALIZER; | |
| 53 - (instancetype)init NS_UNAVAILABLE; | |
| 54 | |
| 55 @end | |
| 56 | |
| 57 #endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONFIGURATION_H_ | |
| OLD | NEW |