| 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 #include "chrome/browser/extensions/script_executor.h" | 5 #include "chrome/browser/extensions/script_executor.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
| 10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (message_request_id != request_id_) | 57 if (message_request_id != request_id_) |
| 58 return false; | 58 return false; |
| 59 | 59 |
| 60 IPC_BEGIN_MESSAGE_MAP(Handler, message) | 60 IPC_BEGIN_MESSAGE_MAP(Handler, message) |
| 61 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, | 61 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, |
| 62 OnExecuteCodeFinished) | 62 OnExecuteCodeFinished) |
| 63 IPC_END_MESSAGE_MAP() | 63 IPC_END_MESSAGE_MAP() |
| 64 return true; | 64 return true; |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE { | 67 virtual void WebContentsDestroyed() OVERRIDE { |
| 68 base::ListValue val; | 68 base::ListValue val; |
| 69 callback_.Run(kRendererDestroyed, -1, GURL(std::string()), val); | 69 callback_.Run(kRendererDestroyed, -1, GURL(std::string()), val); |
| 70 delete this; | 70 delete this; |
| 71 } | 71 } |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 void OnExecuteCodeFinished(int request_id, | 74 void OnExecuteCodeFinished(int request_id, |
| 75 const std::string& error, | 75 const std::string& error, |
| 76 int32 on_page_id, | 76 int32 on_page_id, |
| 77 const GURL& on_url, | 77 const GURL& on_url, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 params.webview_src = webview_src; | 132 params.webview_src = webview_src; |
| 133 params.file_url = file_url; | 133 params.file_url = file_url; |
| 134 params.wants_result = (result_type == JSON_SERIALIZED_RESULT); | 134 params.wants_result = (result_type == JSON_SERIALIZED_RESULT); |
| 135 params.user_gesture = user_gesture; | 135 params.user_gesture = user_gesture; |
| 136 | 136 |
| 137 // Handler handles IPCs and deletes itself on completion. | 137 // Handler handles IPCs and deletes itself on completion. |
| 138 new Handler(script_observers_, web_contents_, params, callback); | 138 new Handler(script_observers_, web_contents_, params, callback); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace extensions | 141 } // namespace extensions |
| OLD | NEW |