| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 base::LazyInstance<ContentActionFactory>::Leaky | 151 base::LazyInstance<ContentActionFactory>::Leaky |
| 152 g_content_action_factory = LAZY_INSTANCE_INITIALIZER; | 152 g_content_action_factory = LAZY_INSTANCE_INITIALIZER; |
| 153 | 153 |
| 154 } // namespace | 154 } // namespace |
| 155 | 155 |
| 156 // | 156 // |
| 157 // RequestContentScript | 157 // RequestContentScript |
| 158 // | 158 // |
| 159 | 159 |
| 160 RequestContentScript::ScriptData::ScriptData() {} | 160 struct RequestContentScript::ScriptData { |
| 161 ScriptData(); |
| 162 ~ScriptData(); |
| 163 |
| 164 std::vector<std::string> css_file_names; |
| 165 std::vector<std::string> js_file_names; |
| 166 bool all_frames; |
| 167 bool match_about_blank; |
| 168 }; |
| 169 |
| 170 RequestContentScript::ScriptData::ScriptData() |
| 171 : all_frames(false), |
| 172 match_about_blank(false) {} |
| 161 RequestContentScript::ScriptData::~ScriptData() {} | 173 RequestContentScript::ScriptData::~ScriptData() {} |
| 162 | 174 |
| 163 // static | 175 // static |
| 164 scoped_refptr<ContentAction> RequestContentScript::Create( | 176 scoped_refptr<ContentAction> RequestContentScript::Create( |
| 165 content::BrowserContext* browser_context, | 177 content::BrowserContext* browser_context, |
| 166 const Extension* extension, | 178 const Extension* extension, |
| 167 const base::DictionaryValue* dict, | 179 const base::DictionaryValue* dict, |
| 168 std::string* error, | 180 std::string* error, |
| 169 bool* bad_message) { | 181 bool* bad_message) { |
| 170 ScriptData script_data; | 182 ScriptData script_data; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 bool* bad_message, | 379 bool* bad_message, |
| 368 const base::DictionaryValue** action_dict, | 380 const base::DictionaryValue** action_dict, |
| 369 std::string* instance_type) { | 381 std::string* instance_type) { |
| 370 INPUT_FORMAT_VALIDATE(json_action.GetAsDictionary(action_dict)); | 382 INPUT_FORMAT_VALIDATE(json_action.GetAsDictionary(action_dict)); |
| 371 INPUT_FORMAT_VALIDATE( | 383 INPUT_FORMAT_VALIDATE( |
| 372 (*action_dict)->GetString(keys::kInstanceType, instance_type)); | 384 (*action_dict)->GetString(keys::kInstanceType, instance_type)); |
| 373 return true; | 385 return true; |
| 374 } | 386 } |
| 375 | 387 |
| 376 } // namespace extensions | 388 } // namespace extensions |
| OLD | NEW |