| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_EXTENSIONS_EXTENSION_VIEW_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // Sets the container for this view. | 49 // Sets the container for this view. |
| 50 void SetContainer(ExtensionContainer* container) { container_ = container; } | 50 void SetContainer(ExtensionContainer* container) { container_ = container; } |
| 51 | 51 |
| 52 // Overridden from views::NativeViewHost: | 52 // Overridden from views::NativeViewHost: |
| 53 virtual void SetVisible(bool is_visible); | 53 virtual void SetVisible(bool is_visible); |
| 54 virtual void DidChangeBounds(const gfx::Rect& previous, | 54 virtual void DidChangeBounds(const gfx::Rect& previous, |
| 55 const gfx::Rect& current); | 55 const gfx::Rect& current); |
| 56 virtual void ViewHierarchyChanged(bool is_add, | 56 virtual void ViewHierarchyChanged(bool is_add, |
| 57 views::View *parent, views::View *child); | 57 views::View *parent, views::View *child); |
| 58 | 58 |
| 59 // Call after extension process crash to re-initialize view, so that |
| 60 // extension content can be rendered again. |
| 61 void RecoverCrashedExtension(); |
| 62 |
| 59 private: | 63 private: |
| 60 friend class ExtensionHost; | 64 friend class ExtensionHost; |
| 61 | 65 |
| 66 // Initializes the RenderWidgetHostView for this object. |
| 67 void CreateWidgetHostView(); |
| 68 |
| 62 // We wait to show the ExtensionView until several things have loaded. | 69 // We wait to show the ExtensionView until several things have loaded. |
| 63 void ShowIfCompletelyLoaded(); | 70 void ShowIfCompletelyLoaded(); |
| 64 | 71 |
| 72 // Restore object to initial state. Called on shutdown or after a renderer |
| 73 // crash. |
| 74 void CleanUp(); |
| 75 |
| 65 // The running extension instance that we're displaying. | 76 // The running extension instance that we're displaying. |
| 66 // Note that host_ owns view | 77 // Note that host_ owns view |
| 67 ExtensionHost* host_; | 78 ExtensionHost* host_; |
| 68 | 79 |
| 69 // The browser window that this view is in. | 80 // The browser window that this view is in. |
| 70 Browser* browser_; | 81 Browser* browser_; |
| 71 | 82 |
| 72 // True if we've been initialized. | 83 // True if we've been initialized. |
| 73 bool initialized_; | 84 bool initialized_; |
| 74 | 85 |
| 75 // The background the view should have once it is initialized. This is set | 86 // The background the view should have once it is initialized. This is set |
| 76 // when the view has a custom background, but hasn't been initialized yet. | 87 // when the view has a custom background, but hasn't been initialized yet. |
| 77 SkBitmap pending_background_; | 88 SkBitmap pending_background_; |
| 78 | 89 |
| 79 // What we should set the preferred width to once the ExtensionView has | 90 // What we should set the preferred width to once the ExtensionView has |
| 80 // loaded. | 91 // loaded. |
| 81 int pending_preferred_width_; | 92 int pending_preferred_width_; |
| 82 | 93 |
| 83 // The container this view is in (not necessarily its direct superview). | 94 // The container this view is in (not necessarily its direct superview). |
| 84 // Note: the view does not own its container. | 95 // Note: the view does not own its container. |
| 85 ExtensionContainer* container_; | 96 ExtensionContainer* container_; |
| 86 | 97 |
| 87 DISALLOW_COPY_AND_ASSIGN(ExtensionView); | 98 DISALLOW_COPY_AND_ASSIGN(ExtensionView); |
| 88 }; | 99 }; |
| 89 | 100 |
| 90 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ | 101 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ |
| OLD | NEW |