summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/external_provider_impl.cc
diff options
context:
space:
mode:
authorPeter Kasting <pkasting@google.com>2014-11-20 15:14:08 -0800
committerPeter Kasting <pkasting@google.com>2014-11-20 23:16:57 +0000
commitbe940e9e152e528fc567c4eeeeb5930710873f98 (patch)
tree8496f9708b39b9ed106be20043e2e37d6ab58eb0 /chrome/browser/extensions/external_provider_impl.cc
parentce6760690b52af662b5684f24dca6edc20832edf (diff)
downloadchromium_src-be940e9e152e528fc567c4eeeeb5930710873f98.zip
chromium_src-be940e9e152e528fc567c4eeeeb5930710873f98.tar.gz
chromium_src-be940e9e152e528fc567c4eeeeb5930710873f98.tar.bz2
Enable MSVC warning for unused locals.
There is seemingly a bug in the compiler where it occasionally claims a local is unused when it isn't. This forces a few places to either inline such locals or mark them ALLOW_UNUSED_LOCAL. BUG=81439 TEST=none R=brettw@chromium.org, cpu@chromium.org, jamesr@chromium.org, rvargas@chromium.org, sievers@chromium.org, sky@chromium.org, vitalybuka@chromium.org, wolenetz@chromium.org Review URL: https://codereview.chromium.org/731373002 Cr-Commit-Position: refs/heads/master@{#305108}
Diffstat (limited to 'chrome/browser/extensions/external_provider_impl.cc')
-rw-r--r--chrome/browser/extensions/external_provider_impl.cc60
1 files changed, 28 insertions, 32 deletions
diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc
index 963ccc4..6a84193 100644
--- a/chrome/browser/extensions/external_provider_impl.cc
+++ b/chrome/browser/extensions/external_provider_impl.cc
@@ -465,7 +465,9 @@ void ExternalProviderImpl::CreateExternalProviders(
#endif
bool is_chromeos_demo_session = false;
+#if !defined(OS_WIN)
int bundled_extension_creation_flags = Extension::NO_FLAGS;
+#endif
#if defined(OS_CHROMEOS)
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
is_chromeos_demo_session =
@@ -473,26 +475,7 @@ void ExternalProviderImpl::CreateExternalProviders(
connector->GetDeviceMode() == policy::DEVICE_MODE_RETAIL_KIOSK;
bundled_extension_creation_flags = Extension::FROM_WEBSTORE |
Extension::WAS_INSTALLED_BY_DEFAULT;
-#endif
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
- if (!profile->IsSupervised()) {
- provider_list->push_back(
- linked_ptr<ExternalProviderInterface>(
- new ExternalProviderImpl(
- service,
- new ExternalPrefLoader(
- chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS,
- ExternalPrefLoader::NONE,
- NULL),
- profile,
- Manifest::EXTERNAL_PREF,
- Manifest::EXTERNAL_PREF_DOWNLOAD,
- bundled_extension_creation_flags)));
- }
-#endif
-
-#if defined(OS_CHROMEOS)
if (!is_chromeos_demo_session && !is_chrome_os_public_session) {
int external_apps_path_id = profile->IsSupervised() ?
chrome::DIR_SUPERVISED_USERS_DEFAULT_APPS :
@@ -538,10 +521,35 @@ void ExternalProviderImpl::CreateExternalProviders(
Manifest::INVALID_LOCATION,
Extension::NO_FLAGS)));
}
+#elif defined(OS_LINUX)
+ if (!profile->IsSupervised()) {
+ provider_list->push_back(
+ linked_ptr<ExternalProviderInterface>(
+ new ExternalProviderImpl(
+ service,
+ new ExternalPrefLoader(
+ chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS,
+ ExternalPrefLoader::NONE,
+ NULL),
+ profile,
+ Manifest::EXTERNAL_PREF,
+ Manifest::EXTERNAL_PREF_DOWNLOAD,
+ bundled_extension_creation_flags)));
+ }
#endif
if (!profile->IsSupervised() && !is_chromeos_demo_session) {
-#if !defined(OS_WIN)
+#if defined(OS_WIN)
+ provider_list->push_back(
+ linked_ptr<ExternalProviderInterface>(
+ new ExternalProviderImpl(
+ service,
+ new ExternalRegistryLoader,
+ profile,
+ Manifest::EXTERNAL_REGISTRY,
+ Manifest::EXTERNAL_PREF_DOWNLOAD,
+ Extension::NO_FLAGS)));
+#else
provider_list->push_back(
linked_ptr<ExternalProviderInterface>(
new ExternalProviderImpl(
@@ -553,7 +561,6 @@ void ExternalProviderImpl::CreateExternalProviders(
Manifest::EXTERNAL_PREF,
Manifest::EXTERNAL_PREF_DOWNLOAD,
bundled_extension_creation_flags)));
-#endif
// Define a per-user source of external extensions.
#if defined(OS_MACOSX)
@@ -569,17 +576,6 @@ void ExternalProviderImpl::CreateExternalProviders(
Manifest::EXTERNAL_PREF_DOWNLOAD,
Extension::NO_FLAGS)));
#endif
-
-#if defined(OS_WIN)
- provider_list->push_back(
- linked_ptr<ExternalProviderInterface>(
- new ExternalProviderImpl(
- service,
- new ExternalRegistryLoader,
- profile,
- Manifest::EXTERNAL_REGISTRY,
- Manifest::EXTERNAL_PREF_DOWNLOAD,
- Extension::NO_FLAGS)));
#endif
#if !defined(OS_CHROMEOS)