OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_OMNIBOX_PAGE_INFO_VIEW_CONTROLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_OMNIBOX_PAGE_INFO_VIEW_CONTROLLER_H_ |
6 #define IOS_CHROME_BROWSER_UI_OMNIBOX_PAGE_INFO_VIEW_CONTROLLER_H_ | 6 #define IOS_CHROME_BROWSER_UI_OMNIBOX_PAGE_INFO_VIEW_CONTROLLER_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "ios/chrome/browser/ui/omnibox/page_info_model_observer.h" | 14 #include "ios/chrome/browser/ui/omnibox/page_info_model_observer.h" |
15 #import "ios/chrome/browser/ui/popup_menu/popup_menu_controller.h" | 15 #import "ios/chrome/browser/ui/popup_menu/popup_menu_controller.h" |
16 | 16 |
17 @class BidiContainerView; | 17 @class BidiContainerView; |
| 18 @protocol BrowserCommands; |
18 class PageInfoModel; | 19 class PageInfoModel; |
19 | 20 |
20 // TODO(crbug.com/227827) Merge 178763: PageInfoModel has been removed in | 21 // TODO(crbug.com/227827) Merge 178763: PageInfoModel has been removed in |
21 // upstream; check if we should use PageInfoModel. | 22 // upstream; check if we should use PageInfoModel. |
22 // The view controller for the page info view. | 23 // The view controller for the page info view. |
23 @interface PageInfoViewController : NSObject | 24 @interface PageInfoViewController : NSObject |
24 // Designated initializer. | 25 // Designated initializer. |
25 // The |source| parameter should be in the coordinate system of the parent. | 26 // The |source| parameter should be in the coordinate system of the parent. |
26 // Typically this would be the frame of a button that resulted in this popup | 27 // Typically this would be the frame of a button that resulted in this popup |
27 // being displayed. | 28 // being displayed. |
28 - (id)initWithModel:(PageInfoModel*)model | 29 - (id)initWithModel:(PageInfoModel*)model |
29 bridge:(PageInfoModelObserver*)bridge | 30 bridge:(PageInfoModelObserver*)bridge |
30 sourceFrame:(CGRect)source | 31 sourceFrame:(CGRect)source |
31 parentView:(UIView*)parent; | 32 parentView:(UIView*)parent; |
32 | 33 |
| 34 // Dispatcher for browser commands. |
| 35 @property(nonatomic, weak) id<BrowserCommands> dispatcher; |
| 36 |
33 // Dismisses the view. | 37 // Dismisses the view. |
34 - (void)dismiss; | 38 - (void)dismiss; |
35 | 39 |
36 // Layout the page info view. | 40 // Layout the page info view. |
37 - (void)performLayout; | 41 - (void)performLayout; |
38 | 42 |
39 @end | 43 @end |
40 | 44 |
41 // Bridge that listens for change notifications from the model. | 45 // Bridge that listens for change notifications from the model. |
42 class PageInfoModelBubbleBridge : public PageInfoModelObserver { | 46 class PageInfoModelBubbleBridge : public PageInfoModelObserver { |
(...skipping 13 matching lines...) Expand all Loading... |
56 void PerformLayout(); | 60 void PerformLayout(); |
57 | 61 |
58 __unsafe_unretained PageInfoViewController* controller_; | 62 __unsafe_unretained PageInfoViewController* controller_; |
59 | 63 |
60 base::WeakPtrFactory<PageInfoModelBubbleBridge> weak_ptr_factory_; | 64 base::WeakPtrFactory<PageInfoModelBubbleBridge> weak_ptr_factory_; |
61 | 65 |
62 DISALLOW_COPY_AND_ASSIGN(PageInfoModelBubbleBridge); | 66 DISALLOW_COPY_AND_ASSIGN(PageInfoModelBubbleBridge); |
63 }; | 67 }; |
64 | 68 |
65 #endif // IOS_CHROME_BROWSER_UI_OMNIBOX_PAGE_INFO_VIEW_CONTROLLER_H_ | 69 #endif // IOS_CHROME_BROWSER_UI_OMNIBOX_PAGE_INFO_VIEW_CONTROLLER_H_ |
OLD | NEW |