| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/extension_function_dispatcher.h" | 5 #include "extensions/browser/extension_function_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 dispatcher_(dispatcher), | 150 dispatcher_(dispatcher), |
| 151 render_view_host_(render_view_host), | 151 render_view_host_(render_view_host), |
| 152 weak_ptr_factory_(this) { | 152 weak_ptr_factory_(this) { |
| 153 } | 153 } |
| 154 | 154 |
| 155 virtual ~UIThreadResponseCallbackWrapper() { | 155 virtual ~UIThreadResponseCallbackWrapper() { |
| 156 } | 156 } |
| 157 | 157 |
| 158 // content::WebContentsObserver overrides. | 158 // content::WebContentsObserver overrides. |
| 159 virtual void RenderViewDeleted( | 159 virtual void RenderViewDeleted( |
| 160 RenderViewHost* render_view_host) OVERRIDE { | 160 RenderViewHost* render_view_host) override { |
| 161 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 161 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 162 if (render_view_host != render_view_host_) | 162 if (render_view_host != render_view_host_) |
| 163 return; | 163 return; |
| 164 | 164 |
| 165 if (dispatcher_.get()) { | 165 if (dispatcher_.get()) { |
| 166 dispatcher_->ui_thread_response_callback_wrappers_ | 166 dispatcher_->ui_thread_response_callback_wrappers_ |
| 167 .erase(render_view_host); | 167 .erase(render_view_host); |
| 168 } | 168 } |
| 169 | 169 |
| 170 delete this; | 170 delete this; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 | 464 |
| 465 // static | 465 // static |
| 466 void ExtensionFunctionDispatcher::SendAccessDenied( | 466 void ExtensionFunctionDispatcher::SendAccessDenied( |
| 467 const ExtensionFunction::ResponseCallback& callback) { | 467 const ExtensionFunction::ResponseCallback& callback) { |
| 468 base::ListValue empty_list; | 468 base::ListValue empty_list; |
| 469 callback.Run(ExtensionFunction::FAILED, empty_list, | 469 callback.Run(ExtensionFunction::FAILED, empty_list, |
| 470 "Access to extension API denied."); | 470 "Access to extension API denied."); |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace extensions | 473 } // namespace extensions |
| OLD | NEW |