| 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 "chrome/browser/extensions/active_script_controller.h" | 5 #include "chrome/browser/extensions/active_script_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "extensions/common/permissions/permissions_data.h" | 33 #include "extensions/common/permissions/permissions_data.h" |
| 34 #include "ipc/ipc_message_macros.h" | 34 #include "ipc/ipc_message_macros.h" |
| 35 | 35 |
| 36 namespace extensions { | 36 namespace extensions { |
| 37 | 37 |
| 38 ActiveScriptController::PendingScript::PendingScript( | 38 ActiveScriptController::PendingScript::PendingScript( |
| 39 UserScript::RunLocation run_location, | 39 UserScript::RunLocation run_location, |
| 40 const base::Closure& permit_script) | 40 const base::Closure& permit_script) |
| 41 : run_location(run_location), permit_script(permit_script) {} | 41 : run_location(run_location), permit_script(permit_script) {} |
| 42 | 42 |
| 43 ActiveScriptController::PendingScript::PendingScript( |
| 44 const PendingScript& other) = default; |
| 45 |
| 43 ActiveScriptController::PendingScript::~PendingScript() {} | 46 ActiveScriptController::PendingScript::~PendingScript() {} |
| 44 | 47 |
| 45 ActiveScriptController::ActiveScriptController( | 48 ActiveScriptController::ActiveScriptController( |
| 46 content::WebContents* web_contents) | 49 content::WebContents* web_contents) |
| 47 : content::WebContentsObserver(web_contents), | 50 : content::WebContentsObserver(web_contents), |
| 48 num_page_requests_(0), | 51 num_page_requests_(0), |
| 49 browser_context_(web_contents->GetBrowserContext()), | 52 browser_context_(web_contents->GetBrowserContext()), |
| 50 was_used_on_page_(false), | 53 was_used_on_page_(false), |
| 51 extension_registry_observer_(this) { | 54 extension_registry_observer_(this) { |
| 52 CHECK(web_contents); | 55 CHECK(web_contents); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 UnloadedExtensionInfo::Reason reason) { | 312 UnloadedExtensionInfo::Reason reason) { |
| 310 PendingScriptMap::iterator iter = pending_scripts_.find(extension->id()); | 313 PendingScriptMap::iterator iter = pending_scripts_.find(extension->id()); |
| 311 if (iter != pending_scripts_.end()) { | 314 if (iter != pending_scripts_.end()) { |
| 312 pending_scripts_.erase(iter); | 315 pending_scripts_.erase(iter); |
| 313 ExtensionActionAPI::Get(browser_context_)-> | 316 ExtensionActionAPI::Get(browser_context_)-> |
| 314 NotifyPageActionsChanged(web_contents()); | 317 NotifyPageActionsChanged(web_contents()); |
| 315 } | 318 } |
| 316 } | 319 } |
| 317 | 320 |
| 318 } // namespace extensions | 321 } // namespace extensions |
| OLD | NEW |