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