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

Side by Side Diff: chrome/browser/about_flags.cc

Issue 12792005: Allow extensions on chrome:// URLs, when flag is set and permission is explicitly requested (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove allowed_schemes attribute from url_pattern; go back to re-using valid_schemes Created 7 years, 9 months 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 | Annotate | Revision Log
OLDNEW
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/about_flags.h" 5 #include "chrome/browser/about_flags.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 SINGLE_VALUE_TYPE(switches::kEnablePnacl) 466 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
467 }, 467 },
468 { 468 {
469 "extension-apis", // FLAGS:RECORD_UMA 469 "extension-apis", // FLAGS:RECORD_UMA
470 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME, 470 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
471 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION, 471 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
472 kOsDesktop, 472 kOsDesktop,
473 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis) 473 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
474 }, 474 },
475 { 475 {
476 "extensions-on-chrome-urls",
477 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
478 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
479 kOsAll,
480 SINGLE_VALUE_TYPE(switches::kExtensionsOnChromeURLs)
481 },
482 {
476 "action-box", 483 "action-box",
477 IDS_FLAGS_ACTION_BOX_NAME, 484 IDS_FLAGS_ACTION_BOX_NAME,
478 IDS_FLAGS_ACTION_BOX_DESCRIPTION, 485 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
479 kOsDesktop, 486 kOsDesktop,
480 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1", 487 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
481 switches::kActionBox, "0") 488 switches::kActionBox, "0")
482 }, 489 },
483 { 490 {
484 "script-badges", 491 "script-badges",
485 IDS_FLAGS_SCRIPT_BADGES_NAME, 492 IDS_FLAGS_SCRIPT_BADGES_NAME,
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 return; 1616 return;
1610 1617
1611 std::set<std::string> enabled_experiments; 1618 std::set<std::string> enabled_experiments;
1612 1619
1613 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments); 1620 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
1614 1621
1615 NameToSwitchAndValueMap name_to_switch_map; 1622 NameToSwitchAndValueMap name_to_switch_map;
1616 for (size_t i = 0; i < num_experiments; ++i) { 1623 for (size_t i = 0; i < num_experiments; ++i) {
1617 const Experiment& e = experiments[i]; 1624 const Experiment& e = experiments[i];
1618 if (e.type == Experiment::SINGLE_VALUE) { 1625 if (e.type == Experiment::SINGLE_VALUE) {
1626 LOG(INFO) << "about to SetFlagToSwitchMapping for " << e.internal_name;
1619 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch, 1627 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1620 e.command_line_value, &name_to_switch_map); 1628 e.command_line_value, &name_to_switch_map);
1621 } else if (e.type == Experiment::MULTI_VALUE) { 1629 } else if (e.type == Experiment::MULTI_VALUE) {
1622 for (int j = 0; j < e.num_choices; ++j) { 1630 for (int j = 0; j < e.num_choices; ++j) {
1623 SetFlagToSwitchMapping(e.NameForChoice(j), 1631 SetFlagToSwitchMapping(e.NameForChoice(j),
1624 e.choices[j].command_line_switch, 1632 e.choices[j].command_line_switch,
1625 e.choices[j].command_line_value, 1633 e.choices[j].command_line_value,
1626 &name_to_switch_map); 1634 &name_to_switch_map);
1627 } 1635 }
1628 } else { 1636 } else {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 } 1780 }
1773 1781
1774 const Experiment* GetExperiments(size_t* count) { 1782 const Experiment* GetExperiments(size_t* count) {
1775 *count = num_experiments; 1783 *count = num_experiments;
1776 return experiments; 1784 return experiments;
1777 } 1785 }
1778 1786
1779 } // namespace testing 1787 } // namespace testing
1780 1788
1781 } // namespace about_flags 1789 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698