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 CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ |
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/extensions/extension_view.h" | 9 #include "chrome/browser/extensions/extension_view.h" |
10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // The minimum/maximum dimensions of the popup. | 38 // The minimum/maximum dimensions of the popup. |
39 // The minimum is just a little larger than the size of the button itself. | 39 // The minimum is just a little larger than the size of the button itself. |
40 // The maximum is an arbitrary number that should be smaller than most | 40 // The maximum is an arbitrary number that should be smaller than most |
41 // screens. | 41 // screens. |
42 static const CGFloat kMinWidth; | 42 static const CGFloat kMinWidth; |
43 static const CGFloat kMinHeight; | 43 static const CGFloat kMinHeight; |
44 static const CGFloat kMaxWidth; | 44 static const CGFloat kMaxWidth; |
45 static const CGFloat kMaxHeight; | 45 static const CGFloat kMaxHeight; |
46 | 46 |
47 ExtensionViewMac(extensions::ExtensionHost* extension_host, Browser* browser); | 47 ExtensionViewMac(extensions::ExtensionHost* extension_host, Browser* browser); |
48 virtual ~ExtensionViewMac(); | 48 ~ExtensionViewMac() override; |
49 | 49 |
50 // Sets the container for this view. | 50 // Sets the container for this view. |
51 void set_container(Container* container) { container_ = container; } | 51 void set_container(Container* container) { container_ = container; } |
52 | 52 |
53 // Informs the view that its containing window's frame changed. | 53 // Informs the view that its containing window's frame changed. |
54 void WindowFrameChanged(); | 54 void WindowFrameChanged(); |
55 | 55 |
56 // extensions::ExtensionView: | 56 // extensions::ExtensionView: |
57 virtual void Init() override; | 57 void Init() override; |
58 virtual Browser* GetBrowser() override; | 58 Browser* GetBrowser() override; |
59 virtual gfx::NativeView GetNativeView() override; | 59 gfx::NativeView GetNativeView() override; |
60 virtual void ResizeDueToAutoResize(const gfx::Size& new_size) override; | 60 void ResizeDueToAutoResize(const gfx::Size& new_size) override; |
61 virtual void RenderViewCreated() override; | 61 void RenderViewCreated() override; |
62 virtual void HandleKeyboardEvent( | 62 void HandleKeyboardEvent( |
63 content::WebContents* source, | 63 content::WebContents* source, |
64 const content::NativeWebKeyboardEvent& event) override; | 64 const content::NativeWebKeyboardEvent& event) override; |
65 virtual void DidStopLoading() override; | 65 void DidStopLoading() override; |
66 | 66 |
67 private: | 67 private: |
68 content::RenderViewHost* render_view_host() const; | 68 content::RenderViewHost* render_view_host() const; |
69 | 69 |
70 void CreateWidgetHostView(); | 70 void CreateWidgetHostView(); |
71 | 71 |
72 // We wait to show the ExtensionView until several things have loaded. | 72 // We wait to show the ExtensionView until several things have loaded. |
73 void ShowIfCompletelyLoaded(); | 73 void ShowIfCompletelyLoaded(); |
74 | 74 |
75 Browser* browser_; // weak | 75 Browser* browser_; // weak |
76 | 76 |
77 extensions::ExtensionHost* extension_host_; // weak | 77 extensions::ExtensionHost* extension_host_; // weak |
78 | 78 |
79 // What we should set the preferred width to once the ExtensionView has | 79 // What we should set the preferred width to once the ExtensionView has |
80 // loaded. | 80 // loaded. |
81 gfx::Size pending_preferred_size_; | 81 gfx::Size pending_preferred_size_; |
82 | 82 |
83 Container* container_; | 83 Container* container_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(ExtensionViewMac); | 85 DISALLOW_COPY_AND_ASSIGN(ExtensionViewMac); |
86 }; | 86 }; |
87 | 87 |
88 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ | 88 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ |
OLD | NEW |