| 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/ui/webui/flags_ui.h" | 5 #include "chrome/browser/ui/webui/flags_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // FlagsDOMHandler | 100 // FlagsDOMHandler |
| 101 // | 101 // |
| 102 //////////////////////////////////////////////////////////////////////////////// | 102 //////////////////////////////////////////////////////////////////////////////// |
| 103 | 103 |
| 104 // The handler for Javascript messages for the about:flags page. | 104 // The handler for Javascript messages for the about:flags page. |
| 105 class FlagsDOMHandler : public WebUIMessageHandler { | 105 class FlagsDOMHandler : public WebUIMessageHandler { |
| 106 public: | 106 public: |
| 107 FlagsDOMHandler() : access_(about_flags::kGeneralAccessFlagsOnly), | 107 FlagsDOMHandler() : access_(about_flags::kGeneralAccessFlagsOnly), |
| 108 flags_experiments_requested_(false) { | 108 flags_experiments_requested_(false) { |
| 109 } | 109 } |
| 110 virtual ~FlagsDOMHandler() {} | 110 ~FlagsDOMHandler() override {} |
| 111 | 111 |
| 112 // Initializes the DOM handler with the provided flags storage and flags | 112 // Initializes the DOM handler with the provided flags storage and flags |
| 113 // access. If there were flags experiments requested from javascript before | 113 // access. If there were flags experiments requested from javascript before |
| 114 // this was called, it calls |HandleRequestFlagsExperiments| again. | 114 // this was called, it calls |HandleRequestFlagsExperiments| again. |
| 115 void Init(about_flags::FlagsStorage* flags_storage, | 115 void Init(about_flags::FlagsStorage* flags_storage, |
| 116 about_flags::FlagAccess access); | 116 about_flags::FlagAccess access); |
| 117 | 117 |
| 118 // WebUIMessageHandler implementation. | 118 // WebUIMessageHandler implementation. |
| 119 virtual void RegisterMessages() override; | 119 void RegisterMessages() override; |
| 120 | 120 |
| 121 // Callback for the "requestFlagsExperiments" message. | 121 // Callback for the "requestFlagsExperiments" message. |
| 122 void HandleRequestFlagsExperiments(const base::ListValue* args); | 122 void HandleRequestFlagsExperiments(const base::ListValue* args); |
| 123 | 123 |
| 124 // Callback for the "enableFlagsExperiment" message. | 124 // Callback for the "enableFlagsExperiment" message. |
| 125 void HandleEnableFlagsExperimentMessage(const base::ListValue* args); | 125 void HandleEnableFlagsExperimentMessage(const base::ListValue* args); |
| 126 | 126 |
| 127 // Callback for the "restartBrowser" message. Restores all tabs on restart. | 127 // Callback for the "restartBrowser" message. Restores all tabs on restart. |
| 128 void HandleRestartBrowser(const base::ListValue* args); | 128 void HandleRestartBrowser(const base::ListValue* args); |
| 129 | 129 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 328 } |
| 329 | 329 |
| 330 #if defined(OS_CHROMEOS) | 330 #if defined(OS_CHROMEOS) |
| 331 // static | 331 // static |
| 332 void FlagsUI::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 332 void FlagsUI::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 333 registry->RegisterListPref(prefs::kEnabledLabsExperiments, | 333 registry->RegisterListPref(prefs::kEnabledLabsExperiments, |
| 334 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 334 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 335 } | 335 } |
| 336 | 336 |
| 337 #endif | 337 #endif |
| OLD | NEW |