| 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" |
| 11 #include "base/memory/ref_counted_memory.h" | 11 #include "base/memory/ref_counted_memory.h" |
| 12 #include "base/prefs/pref_registry_simple.h" | 12 #include "base/prefs/pref_registry_simple.h" |
| 13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/about_flags.h" | 16 #include "chrome/browser/about_flags.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/lifetime/application_lifetime.h" | 18 #include "chrome/browser/lifetime/application_lifetime.h" |
| 19 #include "chrome/browser/pref_service_flags_storage.h" | 19 #include "chrome/browser/pref_service_flags_storage.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/common/chrome_version_info.h" | 21 #include "chrome/common/channel_info.h" |
| 22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
| 24 #include "chrome/grit/chromium_strings.h" | 24 #include "chrome/grit/chromium_strings.h" |
| 25 #include "chrome/grit/generated_resources.h" | 25 #include "chrome/grit/generated_resources.h" |
| 26 #include "components/version_info/version_info.h" |
| 26 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
| 27 #include "content/public/browser/web_ui.h" | 28 #include "content/public/browser/web_ui.h" |
| 28 #include "content/public/browser/web_ui_data_source.h" | 29 #include "content/public/browser/web_ui_data_source.h" |
| 29 #include "content/public/browser/web_ui_message_handler.h" | 30 #include "content/public/browser/web_ui_message_handler.h" |
| 30 #include "grit/browser_resources.h" | 31 #include "grit/browser_resources.h" |
| 31 #include "grit/theme_resources.h" | 32 #include "grit/theme_resources.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
| 34 | 35 |
| 35 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 supported_experiments.get(), | 180 supported_experiments.get(), |
| 180 unsupported_experiments.get()); | 181 unsupported_experiments.get()); |
| 181 results.Set("supportedExperiments", supported_experiments.release()); | 182 results.Set("supportedExperiments", supported_experiments.release()); |
| 182 results.Set("unsupportedExperiments", unsupported_experiments.release()); | 183 results.Set("unsupportedExperiments", unsupported_experiments.release()); |
| 183 results.SetBoolean("needsRestart", | 184 results.SetBoolean("needsRestart", |
| 184 about_flags::IsRestartNeededToCommitChanges()); | 185 about_flags::IsRestartNeededToCommitChanges()); |
| 185 results.SetBoolean("showOwnerWarning", | 186 results.SetBoolean("showOwnerWarning", |
| 186 access_ == about_flags::kGeneralAccessFlagsOnly); | 187 access_ == about_flags::kGeneralAccessFlagsOnly); |
| 187 | 188 |
| 188 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) | 189 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) |
| 189 version_info::Channel channel = chrome::VersionInfo::GetChannel(); | 190 version_info::Channel channel = chrome::GetChannel(); |
| 190 results.SetBoolean("showBetaChannelPromotion", | 191 results.SetBoolean("showBetaChannelPromotion", |
| 191 channel == version_info::Channel::STABLE); | 192 channel == version_info::Channel::STABLE); |
| 192 results.SetBoolean("showDevChannelPromotion", | 193 results.SetBoolean("showDevChannelPromotion", |
| 193 channel == version_info::Channel::BETA); | 194 channel == version_info::Channel::BETA); |
| 194 #else | 195 #else |
| 195 results.SetBoolean("showBetaChannelPromotion", false); | 196 results.SetBoolean("showBetaChannelPromotion", false); |
| 196 results.SetBoolean("showDevChannelPromotion", false); | 197 results.SetBoolean("showDevChannelPromotion", false); |
| 197 #endif | 198 #endif |
| 198 web_ui()->CallJavascriptFunction("returnFlagsExperiments", results); | 199 web_ui()->CallJavascriptFunction("returnFlagsExperiments", results); |
| 199 } | 200 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 registry->RegisterListPref(prefs::kEnabledLabsExperiments); | 331 registry->RegisterListPref(prefs::kEnabledLabsExperiments); |
| 331 } | 332 } |
| 332 | 333 |
| 333 #if defined(OS_CHROMEOS) | 334 #if defined(OS_CHROMEOS) |
| 334 // static | 335 // static |
| 335 void FlagsUI::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 336 void FlagsUI::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 336 registry->RegisterListPref(prefs::kEnabledLabsExperiments); | 337 registry->RegisterListPref(prefs::kEnabledLabsExperiments); |
| 337 } | 338 } |
| 338 | 339 |
| 339 #endif | 340 #endif |
| OLD | NEW |