| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| 11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
| 13 | 13 |
| 14 class Browser; | 14 class Browser; |
| 15 class ExtensionHost; | 15 class ExtensionHost; |
| 16 class SkBitmap; |
| 17 |
| 18 namespace content { |
| 16 class RenderViewHost; | 19 class RenderViewHost; |
| 17 class SkBitmap; | 20 } |
| 18 | 21 |
| 19 // This class represents extension views. An extension view internally contains | 22 // This class represents extension views. An extension view internally contains |
| 20 // a bridge to an extension process, which draws to the extension view's | 23 // a bridge to an extension process, which draws to the extension view's |
| 21 // native view object through IPC. | 24 // native view object through IPC. |
| 22 class ExtensionViewMac { | 25 class ExtensionViewMac { |
| 23 public: | 26 public: |
| 24 class Container { | 27 class Container { |
| 25 public: | 28 public: |
| 26 virtual ~Container() {} | 29 virtual ~Container() {} |
| 27 virtual void OnExtensionPreferredSizeChanged(ExtensionViewMac* view, | 30 virtual void OnExtensionPreferredSizeChanged(ExtensionViewMac* view, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // The minimum/maximum dimensions of the popup. | 69 // The minimum/maximum dimensions of the popup. |
| 67 // The minimum is just a little larger than the size of the button itself. | 70 // The minimum is just a little larger than the size of the button itself. |
| 68 // The maximum is an arbitrary number that should be smaller than most | 71 // The maximum is an arbitrary number that should be smaller than most |
| 69 // screens. | 72 // screens. |
| 70 static const CGFloat kMinWidth; | 73 static const CGFloat kMinWidth; |
| 71 static const CGFloat kMinHeight; | 74 static const CGFloat kMinHeight; |
| 72 static const CGFloat kMaxWidth; | 75 static const CGFloat kMaxWidth; |
| 73 static const CGFloat kMaxHeight; | 76 static const CGFloat kMaxHeight; |
| 74 | 77 |
| 75 private: | 78 private: |
| 76 RenderViewHost* render_view_host() const; | 79 content::RenderViewHost* render_view_host() const; |
| 77 | 80 |
| 78 void CreateWidgetHostView(); | 81 void CreateWidgetHostView(); |
| 79 | 82 |
| 80 // We wait to show the ExtensionView until several things have loaded. | 83 // We wait to show the ExtensionView until several things have loaded. |
| 81 void ShowIfCompletelyLoaded(); | 84 void ShowIfCompletelyLoaded(); |
| 82 | 85 |
| 83 Browser* browser_; // weak | 86 Browser* browser_; // weak |
| 84 | 87 |
| 85 ExtensionHost* extension_host_; // weak | 88 ExtensionHost* extension_host_; // weak |
| 86 | 89 |
| 87 // The background the view should have once it is initialized. This is set | 90 // The background the view should have once it is initialized. This is set |
| 88 // when the view has a custom background, but hasn't been initialized yet. | 91 // when the view has a custom background, but hasn't been initialized yet. |
| 89 SkBitmap pending_background_; | 92 SkBitmap pending_background_; |
| 90 | 93 |
| 91 // What we should set the preferred width to once the ExtensionView has | 94 // What we should set the preferred width to once the ExtensionView has |
| 92 // loaded. | 95 // loaded. |
| 93 gfx::Size pending_preferred_size_; | 96 gfx::Size pending_preferred_size_; |
| 94 | 97 |
| 95 Container* container_; | 98 Container* container_; |
| 96 | 99 |
| 97 DISALLOW_COPY_AND_ASSIGN(ExtensionViewMac); | 100 DISALLOW_COPY_AND_ASSIGN(ExtensionViewMac); |
| 98 }; | 101 }; |
| 99 | 102 |
| 100 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ | 103 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_VIEW_MAC_H_ |
| OLD | NEW |