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

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

Issue 1551743002: Add chrome://flags for update menu item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review, fix histograms test Created 4 years, 11 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <iterator> 7 #include <iterator>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""}, 481 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
482 {IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kNtpSwitchToExistingTab, 482 {IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kNtpSwitchToExistingTab,
483 "disabled"}, 483 "disabled"},
484 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_URL, 484 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_URL,
485 switches::kNtpSwitchToExistingTab, "url"}, 485 switches::kNtpSwitchToExistingTab, "url"},
486 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_HOST, 486 {IDS_FLAGS_NTP_SWITCH_TO_EXISTING_TAB_MATCH_HOST,
487 switches::kNtpSwitchToExistingTab, "host"}, 487 switches::kNtpSwitchToExistingTab, "host"},
488 }; 488 };
489 #endif // defined(OS_ANDROID) 489 #endif // defined(OS_ANDROID)
490 490
491 #if defined(OS_ANDROID)
492 const FeatureEntry::Choice kUpdateMenuItemSummaryChoices[] = {
493 {IDS_FLAGS_UPDATE_MENU_ITEM_NO_SUMMARY, "", ""},
494 {IDS_FLAGS_UPDATE_MENU_ITEM_DEFAULT_SUMMARY,
495 switches::kForceShowUpdateMenuItemSummary, ""},
496 {IDS_FLAGS_UPDATE_MENU_ITEM_CUSTOM_SUMMARY,
497 switches::kForceShowUpdateMenuItemCustomSummary, "Custom summary"},
498 };
499 #endif // defined(OS_ANDROID)
500
491 // RECORDING USER METRICS FOR FLAGS: 501 // RECORDING USER METRICS FOR FLAGS:
492 // ----------------------------------------------------------------------------- 502 // -----------------------------------------------------------------------------
493 // The first line of the entry is the internal name. If you'd like to gather 503 // The first line of the entry is the internal name. If you'd like to gather
494 // statistics about the usage of your flag, you should append a marker comment 504 // statistics about the usage of your flag, you should append a marker comment
495 // to the end of the feature name, like so: 505 // to the end of the feature name, like so:
496 // "my-special-feature", // FLAGS:RECORD_UMA 506 // "my-special-feature", // FLAGS:RECORD_UMA
497 // 507 //
498 // After doing that, run 508 // After doing that, run
499 // tools/metrics/actions/extract_actions.py 509 // tools/metrics/actions/extract_actions.py
500 // to add the metric to actions.xml (which will enable UMA to record your 510 // to add the metric to actions.xml (which will enable UMA to record your
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
2082 IDS_FLAGS_EXPERIMENTAL_FRAMEWORK_NAME, 2092 IDS_FLAGS_EXPERIMENTAL_FRAMEWORK_NAME,
2083 IDS_FLAGS_EXPERIMENTAL_FRAMEWORK_DESCRIPTION, 2093 IDS_FLAGS_EXPERIMENTAL_FRAMEWORK_DESCRIPTION,
2084 kOsAll, 2094 kOsAll,
2085 FEATURE_VALUE_TYPE(features::kExperimentalFramework)}, 2095 FEATURE_VALUE_TYPE(features::kExperimentalFramework)},
2086 #if defined(OS_ANDROID) 2096 #if defined(OS_ANDROID)
2087 {"enable-unified-media-pipeline", 2097 {"enable-unified-media-pipeline",
2088 IDS_FLAGS_ENABLE_UNIFIED_MEDIA_PIPELINE_NAME, 2098 IDS_FLAGS_ENABLE_UNIFIED_MEDIA_PIPELINE_NAME,
2089 IDS_FLAGS_ENABLE_UNIFIED_MEDIA_PIPELINE_DESCRIPTION, kOsAndroid, 2099 IDS_FLAGS_ENABLE_UNIFIED_MEDIA_PIPELINE_DESCRIPTION, kOsAndroid,
2090 SINGLE_VALUE_TYPE(switches::kEnableUnifiedMediaPipeline)}, 2100 SINGLE_VALUE_TYPE(switches::kEnableUnifiedMediaPipeline)},
2091 #endif // OS_ANDROID 2101 #endif // OS_ANDROID
2102 #if defined(OS_ANDROID)
2103 {"force-show-update-menu-item",
2104 IDS_FLAGS_UPDATE_MENU_ITEM_NAME,
2105 IDS_FLAGS_UPDATE_MENU_ITEM_DESCRIPTION,
2106 kOsAndroid,
2107 SINGLE_VALUE_TYPE(switches::kForceShowUpdateMenuItem)},
2108 {"update-menu-item-summary",
2109 IDS_FLAGS_UPDATE_MENU_ITEM_SUMMARY_NAME,
2110 IDS_FLAGS_UPDATE_MENU_ITEM_SUMMARY_DESCRIPTION,
2111 kOsAndroid,
2112 MULTI_VALUE_TYPE(kUpdateMenuItemSummaryChoices)},
2113 {"force-show-update-menu-badge",
2114 IDS_FLAGS_UPDATE_MENU_BADGE_NAME,
2115 IDS_FLAGS_UPDATE_MENU_BADGE_DESCRIPTION,
2116 kOsAndroid,
2117 SINGLE_VALUE_TYPE(switches::kForceShowUpdateMenuBadge)},
2118 {"set-market-url-for-testing",
2119 IDS_FLAGS_SET_MARKET_URL_FOR_TESTING_NAME,
2120 IDS_FLAGS_SET_MARKET_URL_FOR_TESTING_DESCRIPTION,
2121 kOsAndroid,
2122 SINGLE_VALUE_TYPE_AND_VALUE(
2123 switches::kMarketUrlForTesting,
2124 "https://play.google.com/store/apps/details?id=com.android.chrome")},
2125 #endif // OS_ANDROID
2092 // NOTE: Adding new command-line switches requires adding corresponding 2126 // NOTE: Adding new command-line switches requires adding corresponding
2093 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 2127 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2094 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 2128 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2095 }; 2129 };
2096 2130
2097 class FlagsStateSingleton { 2131 class FlagsStateSingleton {
2098 public: 2132 public:
2099 FlagsStateSingleton() 2133 FlagsStateSingleton()
2100 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} 2134 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {}
2101 ~FlagsStateSingleton() {} 2135 ~FlagsStateSingleton() {}
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2329 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2296 2330
2297 const FeatureEntry* GetFeatureEntries(size_t* count) { 2331 const FeatureEntry* GetFeatureEntries(size_t* count) {
2298 *count = arraysize(kFeatureEntries); 2332 *count = arraysize(kFeatureEntries);
2299 return kFeatureEntries; 2333 return kFeatureEntries;
2300 } 2334 }
2301 2335
2302 } // namespace testing 2336 } // namespace testing
2303 2337
2304 } // namespace about_flags 2338 } // namespace about_flags
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698