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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/apps/app_info_dialog.h" | 14 #include "chrome/browser/ui/apps/app_info_dialog.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/common/features.h" |
16 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
17 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
18 #include "chrome/grit/browser_resources.h" | 19 #include "chrome/grit/browser_resources.h" |
19 #include "chrome/grit/chromium_strings.h" | 20 #include "chrome/grit/chromium_strings.h" |
20 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
21 #include "chrome/grit/theme_resources.h" | 22 #include "chrome/grit/theme_resources.h" |
22 #include "components/google/core/browser/google_util.h" | 23 #include "components/google/core/browser/google_util.h" |
23 #include "components/pref_registry/pref_registry_syncable.h" | 24 #include "components/pref_registry/pref_registry_syncable.h" |
24 #include "components/prefs/pref_service.h" | 25 #include "components/prefs/pref_service.h" |
25 #include "components/strings/grit/components_strings.h" | 26 #include "components/strings/grit/components_strings.h" |
26 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
27 #include "content/public/browser/web_ui.h" | 28 #include "content/public/browser/web_ui.h" |
28 #include "content/public/browser/web_ui_data_source.h" | 29 #include "content/public/browser/web_ui_data_source.h" |
29 #include "extensions/browser/extension_registry.h" | 30 #include "extensions/browser/extension_registry.h" |
30 #include "extensions/browser/extension_system.h" | 31 #include "extensions/browser/extension_system.h" |
31 #include "extensions/common/extension.h" | 32 #include "extensions/common/extension.h" |
32 #include "extensions/common/extension_set.h" | 33 #include "extensions/common/extension_set.h" |
33 #include "extensions/common/extension_urls.h" | 34 #include "extensions/common/extension_urls.h" |
34 #include "extensions/common/manifest.h" | 35 #include "extensions/common/manifest.h" |
35 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
36 #include "url/gurl.h" | 37 #include "url/gurl.h" |
37 | 38 |
38 #if defined(ENABLE_SUPERVISED_USERS) | 39 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
39 #include "chrome/browser/supervised_user/supervised_user_service.h" | 40 #include "chrome/browser/supervised_user/supervised_user_service.h" |
40 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 41 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
41 #endif | 42 #endif |
42 | 43 |
43 namespace extensions { | 44 namespace extensions { |
44 | 45 |
45 ExtensionSettingsHandler::ExtensionSettingsHandler() | 46 ExtensionSettingsHandler::ExtensionSettingsHandler() |
46 : extension_service_(nullptr) { | 47 : extension_service_(nullptr) { |
47 } | 48 } |
48 | 49 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 source->AddString("extensionSettingsVisitWebsite", | 141 source->AddString("extensionSettingsVisitWebsite", |
141 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSITE)); | 142 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSITE)); |
142 source->AddString("extensionSettingsVisitWebStore", | 143 source->AddString("extensionSettingsVisitWebStore", |
143 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSTORE)); | 144 l10n_util::GetStringUTF16(IDS_EXTENSIONS_VISIT_WEBSTORE)); |
144 source->AddString("extensionSettingsPolicyControlled", | 145 source->AddString("extensionSettingsPolicyControlled", |
145 l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_CONTROLLED)); | 146 l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_CONTROLLED)); |
146 source->AddString("extensionSettingsPolicyRecommeneded", | 147 source->AddString("extensionSettingsPolicyRecommeneded", |
147 l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_RECOMMENDED)); | 148 l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_RECOMMENDED)); |
148 source->AddString("extensionSettingsDependentExtensions", | 149 source->AddString("extensionSettingsDependentExtensions", |
149 l10n_util::GetStringUTF16(IDS_EXTENSIONS_DEPENDENT_EXTENSIONS)); | 150 l10n_util::GetStringUTF16(IDS_EXTENSIONS_DEPENDENT_EXTENSIONS)); |
150 #if defined(ENABLE_SUPERVISED_USERS) | 151 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
151 const SupervisedUserService* supervised_user_service = | 152 const SupervisedUserService* supervised_user_service = |
152 SupervisedUserServiceFactory::GetForProfile(Profile::FromWebUI(web_ui())); | 153 SupervisedUserServiceFactory::GetForProfile(Profile::FromWebUI(web_ui())); |
153 source->AddString("extensionSettingsSupervisedUser", | 154 source->AddString("extensionSettingsSupervisedUser", |
154 supervised_user_service->GetExtensionsLockedMessage()); | 155 supervised_user_service->GetExtensionsLockedMessage()); |
155 #endif | 156 #endif |
156 source->AddString("loading", | 157 source->AddString("loading", |
157 l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOADING)); | 158 l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOADING)); |
158 source->AddString("extensionSettingsCorruptInstall", | 159 source->AddString("extensionSettingsCorruptInstall", |
159 l10n_util::GetStringUTF16( | 160 l10n_util::GetStringUTF16( |
160 IDS_EXTENSIONS_CORRUPTED_EXTENSION)); | 161 IDS_EXTENSIONS_CORRUPTED_EXTENSION)); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 unpacked_extensions.push_back(extension.get()); | 307 unpacked_extensions.push_back(extension.get()); |
307 } | 308 } |
308 | 309 |
309 for (std::vector<const Extension*>::iterator iter = | 310 for (std::vector<const Extension*>::iterator iter = |
310 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { | 311 unpacked_extensions.begin(); iter != unpacked_extensions.end(); ++iter) { |
311 extension_service_->ReloadExtensionWithQuietFailure((*iter)->id()); | 312 extension_service_->ReloadExtensionWithQuietFailure((*iter)->id()); |
312 } | 313 } |
313 } | 314 } |
314 | 315 |
315 } // namespace extensions | 316 } // namespace extensions |
OLD | NEW |