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/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 UMA_HISTOGRAM_BOOLEAN("ExtensionSettings.ShouldDoVerificationCheck", | 157 UMA_HISTOGRAM_BOOLEAN("ExtensionSettings.ShouldDoVerificationCheck", |
158 should_do_verification_check); | 158 should_do_verification_check); |
159 if (should_do_verification_check) | 159 if (should_do_verification_check) |
160 InstallVerifier::Get(context)->VerifyAllExtensions(); | 160 InstallVerifier::Get(context)->VerifyAllExtensions(); |
161 } | 161 } |
162 | 162 |
163 std::unique_ptr<developer::ProfileInfo> CreateProfileInfo(Profile* profile) { | 163 std::unique_ptr<developer::ProfileInfo> CreateProfileInfo(Profile* profile) { |
164 std::unique_ptr<developer::ProfileInfo> info(new developer::ProfileInfo()); | 164 std::unique_ptr<developer::ProfileInfo> info(new developer::ProfileInfo()); |
165 info->is_supervised = profile->IsSupervised(); | 165 info->is_supervised = profile->IsSupervised(); |
166 PrefService* prefs = profile->GetPrefs(); | 166 PrefService* prefs = profile->GetPrefs(); |
| 167 const PrefService::Preference* pref = |
| 168 prefs->FindPreference(prefs::kExtensionsUIDeveloperMode); |
167 info->is_incognito_available = | 169 info->is_incognito_available = |
168 IncognitoModePrefs::GetAvailability(prefs) != | 170 IncognitoModePrefs::GetAvailability(prefs) != |
169 IncognitoModePrefs::DISABLED; | 171 IncognitoModePrefs::DISABLED; |
| 172 info->is_developer_mode_controlled_by_policy = pref->IsManaged(); |
170 info->in_developer_mode = | 173 info->in_developer_mode = |
171 !info->is_supervised && | 174 !info->is_supervised && |
172 prefs->GetBoolean(prefs::kExtensionsUIDeveloperMode); | 175 prefs->GetBoolean(prefs::kExtensionsUIDeveloperMode); |
173 info->app_info_dialog_enabled = CanShowAppInfoDialog(); | 176 info->app_info_dialog_enabled = CanShowAppInfoDialog(); |
174 info->can_load_unpacked = | 177 info->can_load_unpacked = |
175 !ExtensionManagementFactory::GetForBrowserContext(profile) | 178 !ExtensionManagementFactory::GetForBrowserContext(profile) |
176 ->BlacklistedByDefault(); | 179 ->BlacklistedByDefault(); |
177 return info; | 180 return info; |
178 } | 181 } |
179 | 182 |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 update.extension_id, update.command_name, *update.keybinding); | 1456 update.extension_id, update.command_name, *update.keybinding); |
1454 } | 1457 } |
1455 | 1458 |
1456 return RespondNow(NoArguments()); | 1459 return RespondNow(NoArguments()); |
1457 } | 1460 } |
1458 | 1461 |
1459 | 1462 |
1460 } // namespace api | 1463 } // namespace api |
1461 | 1464 |
1462 } // namespace extensions | 1465 } // namespace extensions |
OLD | NEW |