| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_EXTENSIONS_USER_SCRIPT_IDLE_SCHEDULER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_IDLE_SCHEDULER_H_ |
| 6 #define CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_IDLE_SCHEDULER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_IDLE_SCHEDULER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // ExtensionDispatcher, which contains the mapping from WebFrame to us. | 38 // ExtensionDispatcher, which contains the mapping from WebFrame to us. |
| 39 class UserScriptIdleScheduler { | 39 class UserScriptIdleScheduler { |
| 40 public: | 40 public: |
| 41 UserScriptIdleScheduler(WebKit::WebFrame* frame, | 41 UserScriptIdleScheduler(WebKit::WebFrame* frame, |
| 42 ExtensionDispatcher* extension_dispatcher); | 42 ExtensionDispatcher* extension_dispatcher); |
| 43 ~UserScriptIdleScheduler(); | 43 ~UserScriptIdleScheduler(); |
| 44 | 44 |
| 45 void ExecuteCode(const ExtensionMsg_ExecuteCode_Params& params); | 45 void ExecuteCode(const ExtensionMsg_ExecuteCode_Params& params); |
| 46 void DidFinishDocumentLoad(); | 46 void DidFinishDocumentLoad(); |
| 47 void DidFinishLoad(); | 47 void DidFinishLoad(); |
| 48 void DidStartProvisionalLoad(); | 48 void DidCommitProvisionalLoad(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // Run user scripts, except if they've already run for this frame, or the | 51 // Run user scripts, except if they've already run for this frame, or the |
| 52 // frame has been destroyed. | 52 // frame has been destroyed. |
| 53 void MaybeRun(); | 53 void MaybeRun(); |
| 54 | 54 |
| 55 // Backend for the IPC Message ExecuteCode in addition to being used | 55 // Backend for the IPC Message ExecuteCode in addition to being used |
| 56 // internally. | 56 // internally. |
| 57 void ExecuteCodeImpl(const ExtensionMsg_ExecuteCode_Params& params); | 57 void ExecuteCodeImpl(const ExtensionMsg_ExecuteCode_Params& params); |
| 58 | 58 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 69 bool has_run_; | 69 bool has_run_; |
| 70 | 70 |
| 71 // This is only used if we're for the main frame. | 71 // This is only used if we're for the main frame. |
| 72 std::queue<linked_ptr<ExtensionMsg_ExecuteCode_Params> > | 72 std::queue<linked_ptr<ExtensionMsg_ExecuteCode_Params> > |
| 73 pending_code_execution_queue_; | 73 pending_code_execution_queue_; |
| 74 | 74 |
| 75 ExtensionDispatcher* extension_dispatcher_; | 75 ExtensionDispatcher* extension_dispatcher_; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_IDLE_SCHEDULER_H_ | 78 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_IDLE_SCHEDULER_H_ |
| OLD | NEW |