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

Unified Diff: ios/chrome/browser/ui/tools_menu/tools_menu_context.h

Issue 2588733002: Upstream Chrome on iOS source code [9/11]. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/tools_menu/tools_menu_context.h
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_context.h b/ios/chrome/browser/ui/tools_menu/tools_menu_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..2560f5feb87023a8b2fcde4ba9e68ae9fc9005c8
--- /dev/null
+++ b/ios/chrome/browser/ui/tools_menu/tools_menu_context.h
@@ -0,0 +1,45 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONTEXT_H_
+#define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONTEXT_H_
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+@class ReadingListMenuNotifier;
+
+// Context defining options that can be set to change the tools menu's
+// appearance. All are set to false by default.
+@interface ToolsMenuContext : NSObject
+// Indicate that the menu is being shown while in the tab switcher.
+@property(nonatomic, getter=isInTabSwitcher) BOOL inTabSwitcher;
+// Indicate that the menu is being shown while there are no open tabs.
+@property(nonatomic, getter=hasNoOpenedTabs) BOOL noOpenedTabs;
+// Indicate that the menu is being shown while in incognito mode.
+@property(nonatomic, getter=isInIncognito) BOOL inIncognito;
+// View that the menu will be displayed in.
+@property(nonatomic, readonly) UIView* displayView;
+// Button from which popup menu will be opened.
+@property(nonatomic, assign) UIButton* toolsMenuButton;
+// Menu's origin relative to the |displayView|'s coordinate system, calculated
+// from |toolsMenuButton| and |displayView|.
+@property(nonatomic, readonly) CGRect sourceRect;
+// Image insets that should be applied to the tools button if it is displayed,
+// calculated from |toolsMenuButton|.
+@property(nonatomic, readonly) UIEdgeInsets toolsButtonInsets;
+// Notifier for changes to the reading list requiring the menu to be updated.
+// Menus needing to be updated should set themselves as this object's delegate.
+@property(nonatomic, assign) ReadingListMenuNotifier* readingListMenuNotifier;
+
+// Initialize a ToolsMenuContext instance with default values. |displayView| is
+// the weakly-held parent view within which the popup tools menu using this
+// context will be displayed.
+- (instancetype)initWithDisplayView:(UIView*)displayView
+ NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698