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/ui/webui/extensions/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
6 | 6 |
7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
8 #include "apps/app_window.h" | 8 #include "apps/app_window.h" |
9 #include "apps/app_window_registry.h" | 9 #include "apps/app_window_registry.h" |
10 #include "apps/saved_files_service.h" | 10 #include "apps/saved_files_service.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 i++) { | 278 i++) { |
279 base::DictionaryValue* dependent_entry = new base::DictionaryValue; | 279 base::DictionaryValue* dependent_entry = new base::DictionaryValue; |
280 dependent_entry->SetString("id", (*i)->id()); | 280 dependent_entry->SetString("id", (*i)->id()); |
281 dependent_entry->SetString("name", (*i)->name()); | 281 dependent_entry->SetString("name", (*i)->name()); |
282 dependents_list->Append(dependent_entry); | 282 dependents_list->Append(dependent_entry); |
283 } | 283 } |
284 } | 284 } |
285 extension_data->Set("dependentExtensions", dependents_list); | 285 extension_data->Set("dependentExtensions", dependents_list); |
286 | 286 |
287 // Extensions only want all URL access if: | 287 // Extensions only want all URL access if: |
288 // - The feature is enabled. | 288 // - The feature is enabled for the given extension. |
289 // - The extension has access to enough urls that we can't just let it run | 289 // - The extension has access to enough urls that we can't just let it run |
290 // on those specified in the permissions. | 290 // on those specified in the permissions. |
291 bool wants_all_urls = | 291 bool wants_all_urls = |
292 extension->permissions_data()->HasWithheldImpliedAllHosts() || | 292 util::ScriptsMayRequireActionForExtension(extension) && |
293 util::AllowedScriptingOnAllUrls(extension->id(), | 293 extension->permissions_data()->HasWithheldImpliedAllHosts(); |
294 extension_service_->GetBrowserContext()); | |
295 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); | 294 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); |
296 extension_data->SetBoolean( | 295 extension_data->SetBoolean( |
297 "allowAllUrls", | 296 "allowAllUrls", |
298 util::AllowedScriptingOnAllUrls( | 297 util::AllowedScriptingOnAllUrls( |
299 extension->id(), | 298 extension->id(), |
300 extension_service_->GetBrowserContext())); | 299 extension_service_->GetBrowserContext())); |
301 | 300 |
302 base::string16 location_text; | 301 base::string16 location_text; |
303 if (Manifest::IsPolicyLocation(extension->location())) { | 302 if (Manifest::IsPolicyLocation(extension->location())) { |
304 location_text = l10n_util::GetStringUTF16( | 303 location_text = l10n_util::GetStringUTF16( |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 extension_service_->EnableExtension(extension_id); | 1401 extension_service_->EnableExtension(extension_id); |
1403 } else { | 1402 } else { |
1404 ExtensionErrorReporter::GetInstance()->ReportError( | 1403 ExtensionErrorReporter::GetInstance()->ReportError( |
1405 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1404 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1406 true); // Be noisy. | 1405 true); // Be noisy. |
1407 } | 1406 } |
1408 requirements_checker_.reset(); | 1407 requirements_checker_.reset(); |
1409 } | 1408 } |
1410 | 1409 |
1411 } // namespace extensions | 1410 } // namespace extensions |
OLD | NEW |