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/api/declarative_content/content_action.h" | 5 #include "chrome/browser/extensions/api/declarative_content/content_action.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 return true; | 346 return true; |
347 } | 347 } |
348 | 348 |
349 RequestContentScript::RequestContentScript( | 349 RequestContentScript::RequestContentScript( |
350 content::BrowserContext* browser_context, | 350 content::BrowserContext* browser_context, |
351 const Extension* extension, | 351 const Extension* extension, |
352 const ScriptData& script_data) { | 352 const ScriptData& script_data) { |
353 HostID host_id(HostID::EXTENSIONS, extension->id()); | 353 HostID host_id(HostID::EXTENSIONS, extension->id()); |
354 InitScript(host_id, extension, script_data); | 354 InitScript(host_id, extension, script_data); |
355 | 355 |
356 master_ = ExtensionSystem::Get(browser_context) | 356 master_ = DeclarativeUserScriptManager::Get(browser_context) |
357 ->declarative_user_script_manager() | |
358 ->GetDeclarativeUserScriptMasterByID(host_id); | 357 ->GetDeclarativeUserScriptMasterByID(host_id); |
359 AddScript(); | 358 AddScript(); |
360 } | 359 } |
361 | 360 |
362 RequestContentScript::RequestContentScript( | 361 RequestContentScript::RequestContentScript( |
363 DeclarativeUserScriptMaster* master, | 362 DeclarativeUserScriptMaster* master, |
364 const Extension* extension, | 363 const Extension* extension, |
365 const ScriptData& script_data) { | 364 const ScriptData& script_data) { |
366 HostID host_id(HostID::EXTENSIONS, extension->id()); | 365 HostID host_id(HostID::EXTENSIONS, extension->id()); |
367 InitScript(host_id, extension, script_data); | 366 InitScript(host_id, extension, script_data); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 bool* bad_message, | 498 bool* bad_message, |
500 const base::DictionaryValue** action_dict, | 499 const base::DictionaryValue** action_dict, |
501 std::string* instance_type) { | 500 std::string* instance_type) { |
502 INPUT_FORMAT_VALIDATE(json_action.GetAsDictionary(action_dict)); | 501 INPUT_FORMAT_VALIDATE(json_action.GetAsDictionary(action_dict)); |
503 INPUT_FORMAT_VALIDATE( | 502 INPUT_FORMAT_VALIDATE( |
504 (*action_dict)->GetString(keys::kInstanceType, instance_type)); | 503 (*action_dict)->GetString(keys::kInstanceType, instance_type)); |
505 return true; | 504 return true; |
506 } | 505 } |
507 | 506 |
508 } // namespace extensions | 507 } // namespace extensions |
OLD | NEW |