OLD | NEW |
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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 const Experiment::Choice kNotificationCenterTrayBehaviorChoices[] = { | 367 const Experiment::Choice kNotificationCenterTrayBehaviorChoices[] = { |
368 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, | 368 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
369 { IDS_FLAGS_NOTIFICATION_TRAY_BEHAVIOR_NEVER, | 369 { IDS_FLAGS_NOTIFICATION_TRAY_BEHAVIOR_NEVER, |
370 message_center::switches::kNotificationCenterTrayBehavior, "never" }, | 370 message_center::switches::kNotificationCenterTrayBehavior, "never" }, |
371 { IDS_FLAGS_NOTIFICATION_TRAY_BEHAVIOR_ALWAYS, | 371 { IDS_FLAGS_NOTIFICATION_TRAY_BEHAVIOR_ALWAYS, |
372 message_center::switches::kNotificationCenterTrayBehavior, "always" }, | 372 message_center::switches::kNotificationCenterTrayBehavior, "always" }, |
373 { IDS_FLAGS_NOTIFICATION_TRAY_BEHAVIOR_UNREAD, | 373 { IDS_FLAGS_NOTIFICATION_TRAY_BEHAVIOR_UNREAD, |
374 message_center::switches::kNotificationCenterTrayBehavior, "unread" } | 374 message_center::switches::kNotificationCenterTrayBehavior, "unread" } |
375 }; | 375 }; |
376 | 376 |
| 377 const Experiment::Choice kTouchScrollingModeChoices[] = { |
| 378 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 379 { IDS_FLAGS_TOUCH_SCROLLING_MODE_TOUCHCANCEL, |
| 380 switches::kTouchScrollingMode, |
| 381 switches::kTouchScrollingModeTouchcancel }, |
| 382 { IDS_FLAGS_TOUCH_SCROLLING_MODE_ABSORB_TOUCHMOVE, |
| 383 switches::kTouchScrollingMode, |
| 384 switches::kTouchScrollingModeAbsorbTouchmove }, |
| 385 { IDS_FLAGS_TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE, |
| 386 switches::kTouchScrollingMode, |
| 387 switches::kTouchScrollingModeSyncTouchmove }, |
| 388 }; |
| 389 |
377 // RECORDING USER METRICS FOR FLAGS: | 390 // RECORDING USER METRICS FOR FLAGS: |
378 // ----------------------------------------------------------------------------- | 391 // ----------------------------------------------------------------------------- |
379 // The first line of the experiment is the internal name. If you'd like to | 392 // The first line of the experiment is the internal name. If you'd like to |
380 // gather statistics about the usage of your flag, you should append a marker | 393 // gather statistics about the usage of your flag, you should append a marker |
381 // comment to the end of the feature name, like so: | 394 // comment to the end of the feature name, like so: |
382 // "my-special-feature", // FLAGS:RECORD_UMA | 395 // "my-special-feature", // FLAGS:RECORD_UMA |
383 // | 396 // |
384 // After doing that, run //tools/metrics/actions/extract_actions.py (see | 397 // After doing that, run //tools/metrics/actions/extract_actions.py (see |
385 // instructions at the top of that file for details) to update the | 398 // instructions at the top of that file for details) to update the |
386 // chromeactions.txt file, which will enable UMA to record your feature flag. | 399 // chromeactions.txt file, which will enable UMA to record your feature flag. |
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 }, | 1888 }, |
1876 #if defined(ENABLE_APP_LIST) | 1889 #if defined(ENABLE_APP_LIST) |
1877 { | 1890 { |
1878 "enable-experimental-app-list", | 1891 "enable-experimental-app-list", |
1879 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME, | 1892 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME, |
1880 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION, | 1893 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION, |
1881 kOsWin | kOsLinux | kOsCrOS, | 1894 kOsWin | kOsLinux | kOsCrOS, |
1882 SINGLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList) | 1895 SINGLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList) |
1883 }, | 1896 }, |
1884 #endif | 1897 #endif |
| 1898 { |
| 1899 "touch-scrolling-mode", |
| 1900 IDS_FLAGS_TOUCH_SCROLLING_MODE_NAME, |
| 1901 IDS_FLAGS_TOUCH_SCROLLING_MODE_DESCRIPTION, |
| 1902 kOsWin | kOsLinux | kOsCrOS | kOsAndroid, |
| 1903 MULTI_VALUE_TYPE(kTouchScrollingModeChoices) |
| 1904 }, |
1885 }; | 1905 }; |
1886 | 1906 |
1887 const Experiment* experiments = kExperiments; | 1907 const Experiment* experiments = kExperiments; |
1888 size_t num_experiments = arraysize(kExperiments); | 1908 size_t num_experiments = arraysize(kExperiments); |
1889 | 1909 |
1890 // Stores and encapsulates the little state that about:flags has. | 1910 // Stores and encapsulates the little state that about:flags has. |
1891 class FlagsState { | 1911 class FlagsState { |
1892 public: | 1912 public: |
1893 FlagsState() : needs_restart_(false) {} | 1913 FlagsState() : needs_restart_(false) {} |
1894 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, | 1914 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2394 } | 2414 } |
2395 | 2415 |
2396 const Experiment* GetExperiments(size_t* count) { | 2416 const Experiment* GetExperiments(size_t* count) { |
2397 *count = num_experiments; | 2417 *count = num_experiments; |
2398 return experiments; | 2418 return experiments; |
2399 } | 2419 } |
2400 | 2420 |
2401 } // namespace testing | 2421 } // namespace testing |
2402 | 2422 |
2403 } // namespace about_flags | 2423 } // namespace about_flags |
OLD | NEW |