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

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

Issue 1022333002: Initial CL for Data Saver (Flywheel) prompt when cellular network detected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review, remove hotkey Created 5 years, 8 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
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // NOTE: As the default value must be the empty string, the mask excluding 182 // NOTE: As the default value must be the empty string, the mask excluding
183 // the PNaCl translator and secure shell is substituted elsewhere. 183 // the PNaCl translator and secure shell is substituted elsewhere.
184 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL, "", "" }, 184 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL, "", "" },
185 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL, switches::kNaClDebugMask, "*://*" }, 185 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL, switches::kNaClDebugMask, "*://*" },
186 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG, 186 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
187 switches::kNaClDebugMask, "*://*/*debug.nmf" } 187 switches::kNaClDebugMask, "*://*/*debug.nmf" }
188 }; 188 };
189 #endif 189 #endif
190 190
191 const Experiment::Choice kMarkNonSecureAsChoices[] = { 191 const Experiment::Choice kMarkNonSecureAsChoices[] = {
192 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, 192 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
193 { IDS_MARK_NON_SECURE_AS_NEUTRAL, 193 { IDS_MARK_NON_SECURE_AS_NEUTRAL,
194 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNeutral}, 194 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNeutral},
195 { IDS_MARK_NON_SECURE_AS_NON_SECURE, 195 { IDS_MARK_NON_SECURE_AS_NON_SECURE,
196 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNonSecure}, 196 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNonSecure},
197 { IDS_MARK_NON_SECURE_AS_DUBIOUS, 197 { IDS_MARK_NON_SECURE_AS_DUBIOUS,
198 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsDubious} 198 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsDubious}
199 }; 199 };
200 200
201 const Experiment::Choice kMaxTilesForInterestAreaChoices[] = { 201 const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
202 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, 202 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
203 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT, 203 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
204 cc::switches::kMaxTilesForInterestArea, "64"}, 204 cc::switches::kMaxTilesForInterestArea, "64"},
205 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL, 205 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
206 cc::switches::kMaxTilesForInterestArea, "128"}, 206 cc::switches::kMaxTilesForInterestArea, "128"},
207 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE, 207 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
208 cc::switches::kMaxTilesForInterestArea, "256"}, 208 cc::switches::kMaxTilesForInterestArea, "256"},
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, 301 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
302 switches::kEnableGpuRasterization, "" }, 302 switches::kEnableGpuRasterization, "" },
303 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, 303 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
304 switches::kDisableGpuRasterization, "" }, 304 switches::kDisableGpuRasterization, "" },
305 { IDS_FLAGS_FORCE_GPU_RASTERIZATION, 305 { IDS_FLAGS_FORCE_GPU_RASTERIZATION,
306 switches::kForceGpuRasterization, "" }, 306 switches::kForceGpuRasterization, "" },
307 }; 307 };
308 308
309 #if defined(OS_CHROMEOS) 309 #if defined(OS_CHROMEOS)
310 const Experiment::Choice kMemoryPressureThresholdChoices[] = { 310 const Experiment::Choice kMemoryPressureThresholdChoices[] = {
311 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, 311 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
312 { IDS_FLAGS_CONSERVATIVE_THRESHOLDS, 312 { IDS_FLAGS_CONSERVATIVE_THRESHOLDS,
313 chromeos::switches::kMemoryPressureThresholds, 313 chromeos::switches::kMemoryPressureThresholds,
314 chromeos::switches::kConservativeThreshold }, 314 chromeos::switches::kConservativeThreshold },
315 { IDS_FLAGS_AGGRESSIVE_CACHE_DISCARD_THRESHOLDS, 315 { IDS_FLAGS_AGGRESSIVE_CACHE_DISCARD_THRESHOLDS,
316 chromeos::switches::kMemoryPressureThresholds, 316 chromeos::switches::kMemoryPressureThresholds,
317 chromeos::switches::kAggressiveCacheDiscardThreshold }, 317 chromeos::switches::kAggressiveCacheDiscardThreshold },
318 { IDS_FLAGS_AGGRESSIVE_TAB_DISCARD_THRESHOLDS, 318 { IDS_FLAGS_AGGRESSIVE_TAB_DISCARD_THRESHOLDS,
319 chromeos::switches::kMemoryPressureThresholds, 319 chromeos::switches::kMemoryPressureThresholds,
320 chromeos::switches::kAggressiveTabDiscardThreshold }, 320 chromeos::switches::kAggressiveTabDiscardThreshold },
321 { IDS_FLAGS_AGGRESSIVE_THRESHOLDS, 321 { IDS_FLAGS_AGGRESSIVE_THRESHOLDS,
322 chromeos::switches::kMemoryPressureThresholds, 322 chromeos::switches::kMemoryPressureThresholds,
323 chromeos::switches::kAggressiveThreshold }, 323 chromeos::switches::kAggressiveThreshold },
324 }; 324 };
325 #endif 325 #endif
326 326
327 const Experiment::Choice kExtensionContentVerificationChoices[] = { 327 const Experiment::Choice kExtensionContentVerificationChoices[] = {
328 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, 328 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
329 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP, 329 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP,
330 switches::kExtensionContentVerification, 330 switches::kExtensionContentVerification,
331 switches::kExtensionContentVerificationBootstrap }, 331 switches::kExtensionContentVerificationBootstrap },
332 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE, 332 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE,
333 switches::kExtensionContentVerification, 333 switches::kExtensionContentVerification,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 const Experiment::Choice kFillOnAccountSelectChoices[] = { 386 const Experiment::Choice kFillOnAccountSelectChoices[] = {
387 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, 387 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
388 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, 388 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
389 autofill::switches::kDisableFillOnAccountSelect, "" }, 389 autofill::switches::kDisableFillOnAccountSelect, "" },
390 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_HIGHLIGHTING, 390 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_HIGHLIGHTING,
391 autofill::switches::kEnableFillOnAccountSelect, "" }, 391 autofill::switches::kEnableFillOnAccountSelect, "" },
392 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_NO_HIGHLIGHTING, 392 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_NO_HIGHLIGHTING,
393 autofill::switches::kEnableFillOnAccountSelectNoHighlighting, "" }, 393 autofill::switches::kEnableFillOnAccountSelectNoHighlighting, "" },
394 }; 394 };
395 395
396 #if defined(OS_CHROMEOS)
397 const Experiment::Choice kDataSaverPromptChoices[] = {
398 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
399 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
400 chromeos::switches::kDisableDataSaverPrompt, "" },
401 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
402 chromeos::switches::kEnableDataSaverPrompt, "" },
403 { IDS_FLAGS_DATASAVER_PROMPT_DEMO_MODE,
404 chromeos::switches::kEnableDataSaverPrompt,
405 chromeos::switches::kDataSaverPromptDemoMode },
406 };
407 #endif
408
396 // RECORDING USER METRICS FOR FLAGS: 409 // RECORDING USER METRICS FOR FLAGS:
397 // ----------------------------------------------------------------------------- 410 // -----------------------------------------------------------------------------
398 // The first line of the experiment is the internal name. If you'd like to 411 // The first line of the experiment is the internal name. If you'd like to
399 // gather statistics about the usage of your flag, you should append a marker 412 // gather statistics about the usage of your flag, you should append a marker
400 // comment to the end of the feature name, like so: 413 // comment to the end of the feature name, like so:
401 // "my-special-feature", // FLAGS:RECORD_UMA 414 // "my-special-feature", // FLAGS:RECORD_UMA
402 // 415 //
403 // After doing that, run 416 // After doing that, run
404 // tools/metrics/actions/extract_actions.py 417 // tools/metrics/actions/extract_actions.py
405 // to add the metric to actions.xml (which will enable UMA to record your 418 // to add the metric to actions.xml (which will enable UMA to record your
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
2178 }, 2191 },
2179 { 2192 {
2180 "use-sync-sandbox", 2193 "use-sync-sandbox",
2181 IDS_FLAGS_SYNC_SANDBOX_NAME, 2194 IDS_FLAGS_SYNC_SANDBOX_NAME,
2182 IDS_FLAGS_SYNC_SANDBOX_DESCRIPTION, 2195 IDS_FLAGS_SYNC_SANDBOX_DESCRIPTION,
2183 kOsAll, 2196 kOsAll,
2184 SINGLE_VALUE_TYPE_AND_VALUE( 2197 SINGLE_VALUE_TYPE_AND_VALUE(
2185 switches::kSyncServiceURL, 2198 switches::kSyncServiceURL,
2186 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha") 2199 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")
2187 }, 2200 },
2201 #if defined(OS_CHROMEOS)
2202 {
2203 "enable-datasaver-prompt",
2204 IDS_FLAGS_DATASAVER_PROMPT_NAME,
2205 IDS_FLAGS_DATASAVER_PROMPT_DESCRIPTION,
2206 kOsCrOS,
2207 MULTI_VALUE_TYPE(kDataSaverPromptChoices)
2208 },
2209 #endif // defined(OS_CHROMEOS)
2188 2210
2189 // NOTE: Adding new command-line switches requires adding corresponding 2211 // NOTE: Adding new command-line switches requires adding corresponding
2190 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 2212 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2191 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 2213 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2192 }; 2214 };
2193 2215
2194 const Experiment* experiments = kExperiments; 2216 const Experiment* experiments = kExperiments;
2195 size_t num_experiments = arraysize(kExperiments); 2217 size_t num_experiments = arraysize(kExperiments);
2196 2218
2197 // Stores and encapsulates the little state that about:flags has. 2219 // Stores and encapsulates the little state that about:flags has.
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
2781 } 2803 }
2782 2804
2783 const Experiment* GetExperiments(size_t* count) { 2805 const Experiment* GetExperiments(size_t* count) {
2784 *count = num_experiments; 2806 *count = num_experiments;
2785 return experiments; 2807 return experiments;
2786 } 2808 }
2787 2809
2788 } // namespace testing 2810 } // namespace testing
2789 2811
2790 } // namespace about_flags 2812 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698