| 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 <memory> | |
| 8 #include <string> | 7 #include <string> |
| 9 #include <utility> | |
| 10 | 8 |
| 11 #include "base/bind.h" | 9 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 13 #include "base/macros.h" | 11 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/values.h" | 14 #include "base/values.h" |
| 17 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 18 #include "chrome/browser/about_flags.h" | 16 #include "chrome/browser/about_flags.h" |
| 19 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 return; | 185 return; |
| 188 | 186 |
| 189 base::DictionaryValue results; | 187 base::DictionaryValue results; |
| 190 | 188 |
| 191 std::unique_ptr<base::ListValue> supported_features(new base::ListValue); | 189 std::unique_ptr<base::ListValue> supported_features(new base::ListValue); |
| 192 std::unique_ptr<base::ListValue> unsupported_features(new base::ListValue); | 190 std::unique_ptr<base::ListValue> unsupported_features(new base::ListValue); |
| 193 about_flags::GetFlagFeatureEntries(flags_storage_.get(), | 191 about_flags::GetFlagFeatureEntries(flags_storage_.get(), |
| 194 access_, | 192 access_, |
| 195 supported_features.get(), | 193 supported_features.get(), |
| 196 unsupported_features.get()); | 194 unsupported_features.get()); |
| 197 results.Set(flags_ui::kSupportedFeatures, std::move(supported_features)); | 195 results.Set(flags_ui::kSupportedFeatures, supported_features.release()); |
| 198 results.Set(flags_ui::kUnsupportedFeatures, std::move(unsupported_features)); | 196 results.Set(flags_ui::kUnsupportedFeatures, unsupported_features.release()); |
| 199 results.SetBoolean(flags_ui::kNeedsRestart, | 197 results.SetBoolean(flags_ui::kNeedsRestart, |
| 200 about_flags::IsRestartNeededToCommitChanges()); | 198 about_flags::IsRestartNeededToCommitChanges()); |
| 201 results.SetBoolean(flags_ui::kShowOwnerWarning, | 199 results.SetBoolean(flags_ui::kShowOwnerWarning, |
| 202 access_ == flags_ui::kGeneralAccessFlagsOnly); | 200 access_ == flags_ui::kGeneralAccessFlagsOnly); |
| 203 | 201 |
| 204 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) | 202 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) |
| 205 version_info::Channel channel = chrome::GetChannel(); | 203 version_info::Channel channel = chrome::GetChannel(); |
| 206 results.SetBoolean(flags_ui::kShowBetaChannelPromotion, | 204 results.SetBoolean(flags_ui::kShowBetaChannelPromotion, |
| 207 channel == version_info::Channel::STABLE); | 205 channel == version_info::Channel::STABLE); |
| 208 results.SetBoolean(flags_ui::kShowDevChannelPromotion, | 206 results.SetBoolean(flags_ui::kShowDevChannelPromotion, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 334 |
| 337 FlagsUI::~FlagsUI() { | 335 FlagsUI::~FlagsUI() { |
| 338 } | 336 } |
| 339 | 337 |
| 340 // static | 338 // static |
| 341 base::RefCountedMemory* FlagsUI::GetFaviconResourceBytes( | 339 base::RefCountedMemory* FlagsUI::GetFaviconResourceBytes( |
| 342 ui::ScaleFactor scale_factor) { | 340 ui::ScaleFactor scale_factor) { |
| 343 return ResourceBundle::GetSharedInstance(). | 341 return ResourceBundle::GetSharedInstance(). |
| 344 LoadDataResourceBytesForScale(IDR_FLAGS_FAVICON, scale_factor); | 342 LoadDataResourceBytesForScale(IDR_FLAGS_FAVICON, scale_factor); |
| 345 } | 343 } |
| OLD | NEW |