| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ | 5 #ifndef EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ |
| 6 #define EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ | 6 #define EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 const std::string& extension_id, | 45 const std::string& extension_id, |
| 46 int browser_window_id, | 46 int browser_window_id, |
| 47 int tab_id, | 47 int tab_id, |
| 48 ViewType view_type); | 48 ViewType view_type); |
| 49 | 49 |
| 50 // Returns the main frame of the extension's background page, or null if there | 50 // Returns the main frame of the extension's background page, or null if there |
| 51 // isn't one in this process. | 51 // isn't one in this process. |
| 52 static content::RenderFrame* GetBackgroundPageFrame( | 52 static content::RenderFrame* GetBackgroundPageFrame( |
| 53 const std::string& extension_id); | 53 const std::string& extension_id); |
| 54 | 54 |
| 55 // Finds a frame with the given |name|. |
| 56 static content::RenderFrame* FindFrame( |
| 57 content::RenderFrame* relative_to_frame, |
| 58 const std::string& name); |
| 59 |
| 55 // Returns true if the given |context| is for any frame in the extension's | 60 // Returns true if the given |context| is for any frame in the extension's |
| 56 // event page. | 61 // event page. |
| 57 // TODO(devlin): This isn't really used properly, and should probably be | 62 // TODO(devlin): This isn't really used properly, and should probably be |
| 58 // deleted. | 63 // deleted. |
| 59 static bool IsContextForEventPage(const ScriptContext* context); | 64 static bool IsContextForEventPage(const ScriptContext* context); |
| 60 | 65 |
| 61 ViewType view_type() const { return view_type_; } | 66 ViewType view_type() const { return view_type_; } |
| 62 int tab_id() const { return tab_id_; } | 67 int tab_id() const { return tab_id_; } |
| 63 int browser_window_id() const { return browser_window_id_; } | 68 int browser_window_id() const { return browser_window_id_; } |
| 64 bool did_create_current_document_element() const { | 69 bool did_create_current_document_element() const { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 bool delayed_main_world_script_initialization_ = false; | 159 bool delayed_main_world_script_initialization_ = false; |
| 155 | 160 |
| 156 base::WeakPtrFactory<ExtensionFrameHelper> weak_ptr_factory_; | 161 base::WeakPtrFactory<ExtensionFrameHelper> weak_ptr_factory_; |
| 157 | 162 |
| 158 DISALLOW_COPY_AND_ASSIGN(ExtensionFrameHelper); | 163 DISALLOW_COPY_AND_ASSIGN(ExtensionFrameHelper); |
| 159 }; | 164 }; |
| 160 | 165 |
| 161 } // namespace extensions | 166 } // namespace extensions |
| 162 | 167 |
| 163 #endif // EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ | 168 #endif // EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ |
| OLD | NEW |