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/renderer/extensions/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/sha1.h" | 12 #include "base/sha1.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "chrome/common/child_process_logging.h" | |
18 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/chrome_version_info.h" | 18 #include "chrome/common/chrome_version_info.h" |
| 19 #include "chrome/common/crash_keys.h" |
20 #include "chrome/common/extensions/api/extension_api.h" | 20 #include "chrome/common/extensions/api/extension_api.h" |
21 #include "chrome/common/extensions/api/runtime.h" | 21 #include "chrome/common/extensions/api/runtime.h" |
22 #include "chrome/common/extensions/background_info.h" | 22 #include "chrome/common/extensions/background_info.h" |
23 #include "chrome/common/extensions/extension.h" | 23 #include "chrome/common/extensions/extension.h" |
24 #include "chrome/common/extensions/extension_constants.h" | 24 #include "chrome/common/extensions/extension_constants.h" |
25 #include "chrome/common/extensions/extension_messages.h" | 25 #include "chrome/common/extensions/extension_messages.h" |
26 #include "chrome/common/extensions/features/feature_channel.h" | 26 #include "chrome/common/extensions/features/feature_channel.h" |
27 #include "chrome/common/extensions/manifest_handlers/externally_connectable.h" | 27 #include "chrome/common/extensions/manifest_handlers/externally_connectable.h" |
28 #include "chrome/common/extensions/manifest_handlers/sandboxed_page_info.h" | 28 #include "chrome/common/extensions/manifest_handlers/sandboxed_page_info.h" |
29 #include "chrome/common/extensions/message_bundle.h" | 29 #include "chrome/common/extensions/message_bundle.h" |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 UpdateActiveExtensions(); | 1387 UpdateActiveExtensions(); |
1388 } | 1388 } |
1389 | 1389 |
1390 void Dispatcher::UpdateActiveExtensions() { | 1390 void Dispatcher::UpdateActiveExtensions() { |
1391 // In single-process mode, the browser process reports the active extensions. | 1391 // In single-process mode, the browser process reports the active extensions. |
1392 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | 1392 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) |
1393 return; | 1393 return; |
1394 | 1394 |
1395 std::set<std::string> active_extensions = active_extension_ids_; | 1395 std::set<std::string> active_extensions = active_extension_ids_; |
1396 user_script_slave_->GetActiveExtensions(&active_extensions); | 1396 user_script_slave_->GetActiveExtensions(&active_extensions); |
1397 child_process_logging::SetActiveExtensions(active_extensions); | 1397 crash_keys::SetActiveExtensions(active_extensions); |
1398 } | 1398 } |
1399 | 1399 |
1400 void Dispatcher::OnUsingWebRequestAPI( | 1400 void Dispatcher::OnUsingWebRequestAPI( |
1401 bool adblock, bool adblock_plus, bool other) { | 1401 bool adblock, bool adblock_plus, bool other) { |
1402 webrequest_adblock_ = adblock; | 1402 webrequest_adblock_ = adblock; |
1403 webrequest_adblock_plus_ = adblock_plus; | 1403 webrequest_adblock_plus_ = adblock_plus; |
1404 webrequest_other_ = other; | 1404 webrequest_other_ = other; |
1405 } | 1405 } |
1406 | 1406 |
1407 void Dispatcher::OnShouldSuspend(const std::string& extension_id, | 1407 void Dispatcher::OnShouldSuspend(const std::string& extension_id, |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 RenderView* background_view = | 1562 RenderView* background_view = |
1563 ExtensionHelper::GetBackgroundPage(extension_id); | 1563 ExtensionHelper::GetBackgroundPage(extension_id); |
1564 if (background_view) { | 1564 if (background_view) { |
1565 background_view->Send(new ExtensionHostMsg_EventAck( | 1565 background_view->Send(new ExtensionHostMsg_EventAck( |
1566 background_view->GetRoutingID())); | 1566 background_view->GetRoutingID())); |
1567 } | 1567 } |
1568 } | 1568 } |
1569 } | 1569 } |
1570 | 1570 |
1571 } // namespace extensions | 1571 } // namespace extensions |
OLD | NEW |