Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: chrome/browser/ui/webui/flags_ui.cc

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: Rebased Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
jdoerrie 2017/04/13 09:08:51 #include <memory> #include <utility>
vabr (Chromium) 2017/04/13 12:03:14 Done.
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/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted_memory.h" 12 #include "base/memory/ref_counted_memory.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "build/build_config.h" 15 #include "build/build_config.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"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 return; 185 return;
186 186
187 base::DictionaryValue results; 187 base::DictionaryValue results;
188 188
189 std::unique_ptr<base::ListValue> supported_features(new base::ListValue); 189 std::unique_ptr<base::ListValue> supported_features(new base::ListValue);
190 std::unique_ptr<base::ListValue> unsupported_features(new base::ListValue); 190 std::unique_ptr<base::ListValue> unsupported_features(new base::ListValue);
191 about_flags::GetFlagFeatureEntries(flags_storage_.get(), 191 about_flags::GetFlagFeatureEntries(flags_storage_.get(),
192 access_, 192 access_,
193 supported_features.get(), 193 supported_features.get(),
194 unsupported_features.get()); 194 unsupported_features.get());
195 results.Set(flags_ui::kSupportedFeatures, supported_features.release()); 195 results.Set(flags_ui::kSupportedFeatures, std::move(supported_features));
196 results.Set(flags_ui::kUnsupportedFeatures, unsupported_features.release()); 196 results.Set(flags_ui::kUnsupportedFeatures, std::move(unsupported_features));
197 results.SetBoolean(flags_ui::kNeedsRestart, 197 results.SetBoolean(flags_ui::kNeedsRestart,
198 about_flags::IsRestartNeededToCommitChanges()); 198 about_flags::IsRestartNeededToCommitChanges());
199 results.SetBoolean(flags_ui::kShowOwnerWarning, 199 results.SetBoolean(flags_ui::kShowOwnerWarning,
200 access_ == flags_ui::kGeneralAccessFlagsOnly); 200 access_ == flags_ui::kGeneralAccessFlagsOnly);
201 201
202 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) 202 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
203 version_info::Channel channel = chrome::GetChannel(); 203 version_info::Channel channel = chrome::GetChannel();
204 results.SetBoolean(flags_ui::kShowBetaChannelPromotion, 204 results.SetBoolean(flags_ui::kShowBetaChannelPromotion,
205 channel == version_info::Channel::STABLE); 205 channel == version_info::Channel::STABLE);
206 results.SetBoolean(flags_ui::kShowDevChannelPromotion, 206 results.SetBoolean(flags_ui::kShowDevChannelPromotion,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 FlagsUI::~FlagsUI() { 335 FlagsUI::~FlagsUI() {
336 } 336 }
337 337
338 // static 338 // static
339 base::RefCountedMemory* FlagsUI::GetFaviconResourceBytes( 339 base::RefCountedMemory* FlagsUI::GetFaviconResourceBytes(
340 ui::ScaleFactor scale_factor) { 340 ui::ScaleFactor scale_factor) {
341 return ResourceBundle::GetSharedInstance(). 341 return ResourceBundle::GetSharedInstance().
342 LoadDataResourceBytesForScale(IDR_FLAGS_FAVICON, scale_factor); 342 LoadDataResourceBytesForScale(IDR_FLAGS_FAVICON, scale_factor);
343 } 343 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698