Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1221)

Side by Side Diff: extensions/common/features/simple_feature.cc

Issue 819193002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/common/features/simple_feature.h" 5 #include "extensions/common/features/simple_feature.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 // See http://crbug.com/370375 for more details. 346 // See http://crbug.com/370375 for more details.
347 // Component extensions can access any feature. 347 // Component extensions can access any feature.
348 // NOTE: Deliberately does not match EXTERNAL_COMPONENT. 348 // NOTE: Deliberately does not match EXTERNAL_COMPONENT.
349 if (component_extensions_auto_granted_ && location == Manifest::COMPONENT) 349 if (component_extensions_auto_granted_ && location == Manifest::COMPONENT)
350 return CreateAvailability(IS_AVAILABLE, type); 350 return CreateAvailability(IS_AVAILABLE, type);
351 351
352 if (!whitelist_.empty()) { 352 if (!whitelist_.empty()) {
353 if (!IsIdInWhitelist(extension_id)) { 353 if (!IsIdInWhitelist(extension_id)) {
354 // TODO(aa): This is gross. There should be a better way to test the 354 // TODO(aa): This is gross. There should be a better way to test the
355 // whitelist. 355 // whitelist.
356 CommandLine* command_line = CommandLine::ForCurrentProcess(); 356 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
357 if (!command_line->HasSwitch(switches::kWhitelistedExtensionID)) 357 if (!command_line->HasSwitch(switches::kWhitelistedExtensionID))
358 return CreateAvailability(NOT_FOUND_IN_WHITELIST, type); 358 return CreateAvailability(NOT_FOUND_IN_WHITELIST, type);
359 359
360 std::string whitelist_switch_value = 360 std::string whitelist_switch_value =
361 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 361 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
362 switches::kWhitelistedExtensionID); 362 switches::kWhitelistedExtensionID);
363 if (extension_id != whitelist_switch_value) 363 if (extension_id != whitelist_switch_value)
364 return CreateAvailability(NOT_FOUND_IN_WHITELIST, type); 364 return CreateAvailability(NOT_FOUND_IN_WHITELIST, type);
365 } 365 }
366 } 366 }
367 367
368 if (!MatchesManifestLocation(location)) 368 if (!MatchesManifestLocation(location))
369 return CreateAvailability(INVALID_LOCATION, type); 369 return CreateAvailability(INVALID_LOCATION, type);
370 370
371 if (!platforms_.empty() && 371 if (!platforms_.empty() &&
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 if (!dependency) 593 if (!dependency)
594 return CreateAvailability(NOT_PRESENT); 594 return CreateAvailability(NOT_PRESENT);
595 Availability dependency_availability = checker.Run(dependency); 595 Availability dependency_availability = checker.Run(dependency);
596 if (!dependency_availability.is_available()) 596 if (!dependency_availability.is_available())
597 return dependency_availability; 597 return dependency_availability;
598 } 598 }
599 return CreateAvailability(IS_AVAILABLE); 599 return CreateAvailability(IS_AVAILABLE);
600 } 600 }
601 601
602 } // namespace extensions 602 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/feature_switch.cc ('k') | extensions/common/manifest_handlers/background_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698