| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Returns true if the given |context| is for any frame in the extension's | 55 // Returns true if the given |context| is for any frame in the extension's |
| 56 // event page. | 56 // event page. |
| 57 // TODO(devlin): This isn't really used properly, and should probably be | 57 // TODO(devlin): This isn't really used properly, and should probably be |
| 58 // deleted. | 58 // deleted. |
| 59 static bool IsContextForEventPage(const ScriptContext* context); | 59 static bool IsContextForEventPage(const ScriptContext* context); |
| 60 // Returns true if the given |context| is for an extension service worker. |
| 61 static bool IsContextForSW(const ScriptContext& context); |
| 60 | 62 |
| 61 ViewType view_type() const { return view_type_; } | 63 ViewType view_type() const { return view_type_; } |
| 62 int tab_id() const { return tab_id_; } | 64 int tab_id() const { return tab_id_; } |
| 63 int browser_window_id() const { return browser_window_id_; } | 65 int browser_window_id() const { return browser_window_id_; } |
| 64 bool did_create_current_document_element() const { | 66 bool did_create_current_document_element() const { |
| 65 return did_create_current_document_element_; | 67 return did_create_current_document_element_; |
| 66 } | 68 } |
| 67 | 69 |
| 68 // Called when the document element has been inserted in this frame. This | 70 // Called when the document element has been inserted in this frame. This |
| 69 // method may invoke untrusted JavaScript code that invalidate the frame and | 71 // method may invoke untrusted JavaScript code that invalidate the frame and |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 bool delayed_main_world_script_initialization_ = false; | 156 bool delayed_main_world_script_initialization_ = false; |
| 155 | 157 |
| 156 base::WeakPtrFactory<ExtensionFrameHelper> weak_ptr_factory_; | 158 base::WeakPtrFactory<ExtensionFrameHelper> weak_ptr_factory_; |
| 157 | 159 |
| 158 DISALLOW_COPY_AND_ASSIGN(ExtensionFrameHelper); | 160 DISALLOW_COPY_AND_ASSIGN(ExtensionFrameHelper); |
| 159 }; | 161 }; |
| 160 | 162 |
| 161 } // namespace extensions | 163 } // namespace extensions |
| 162 | 164 |
| 163 #endif // EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ | 165 #endif // EXTENSIONS_RENDERER_EXTENSION_FRAME_HELPER_H_ |
| OLD | NEW |