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

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

Issue 1861593005: Convert //ios from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/ui/webui/flags_ui.h" 5 #include "ios/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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Callback for the "enableExperimentalFeature" message. 106 // Callback for the "enableExperimentalFeature" message.
107 void HandleEnableExperimentalFeatureMessage(const base::ListValue* args); 107 void HandleEnableExperimentalFeatureMessage(const base::ListValue* args);
108 108
109 // Callback for the "restartBrowser" message. Restores all tabs on restart. 109 // Callback for the "restartBrowser" message. Restores all tabs on restart.
110 void HandleRestartBrowser(const base::ListValue* args); 110 void HandleRestartBrowser(const base::ListValue* args);
111 111
112 // Callback for the "resetAllFlags" message. 112 // Callback for the "resetAllFlags" message.
113 void HandleResetAllFlags(const base::ListValue* args); 113 void HandleResetAllFlags(const base::ListValue* args);
114 114
115 private: 115 private:
116 scoped_ptr<flags_ui::FlagsStorage> flags_storage_; 116 std::unique_ptr<flags_ui::FlagsStorage> flags_storage_;
117 flags_ui::FlagAccess access_; 117 flags_ui::FlagAccess access_;
118 bool experimental_features_requested_; 118 bool experimental_features_requested_;
119 119
120 DISALLOW_COPY_AND_ASSIGN(FlagsDOMHandler); 120 DISALLOW_COPY_AND_ASSIGN(FlagsDOMHandler);
121 }; 121 };
122 122
123 void FlagsDOMHandler::RegisterMessages() { 123 void FlagsDOMHandler::RegisterMessages() {
124 web_ui()->RegisterMessageCallback( 124 web_ui()->RegisterMessageCallback(
125 flags_ui::kRequestExperimentalFeatures, 125 flags_ui::kRequestExperimentalFeatures,
126 base::Bind(&FlagsDOMHandler::HandleRequestExperimentalFeatures, 126 base::Bind(&FlagsDOMHandler::HandleRequestExperimentalFeatures,
(...skipping 24 matching lines...) Expand all
151 void FlagsDOMHandler::HandleRequestExperimentalFeatures( 151 void FlagsDOMHandler::HandleRequestExperimentalFeatures(
152 const base::ListValue* args) { 152 const base::ListValue* args) {
153 experimental_features_requested_ = true; 153 experimental_features_requested_ = true;
154 // Bail out if the handler hasn't been initialized yet. The request will be 154 // Bail out if the handler hasn't been initialized yet. The request will be
155 // handled after the initialization. 155 // handled after the initialization.
156 if (!flags_storage_) 156 if (!flags_storage_)
157 return; 157 return;
158 158
159 base::DictionaryValue results; 159 base::DictionaryValue results;
160 160
161 scoped_ptr<base::ListValue> supported_features(new base::ListValue); 161 std::unique_ptr<base::ListValue> supported_features(new base::ListValue);
162 scoped_ptr<base::ListValue> unsupported_features(new base::ListValue); 162 std::unique_ptr<base::ListValue> unsupported_features(new base::ListValue);
163 GetFlagFeatureEntries(flags_storage_.get(), access_, supported_features.get(), 163 GetFlagFeatureEntries(flags_storage_.get(), access_, supported_features.get(),
164 unsupported_features.get()); 164 unsupported_features.get());
165 results.Set(flags_ui::kSupportedFeatures, supported_features.release()); 165 results.Set(flags_ui::kSupportedFeatures, supported_features.release());
166 results.Set(flags_ui::kUnsupportedFeatures, unsupported_features.release()); 166 results.Set(flags_ui::kUnsupportedFeatures, unsupported_features.release());
167 // Cannot restart the browser on iOS. 167 // Cannot restart the browser on iOS.
168 results.SetBoolean(flags_ui::kNeedsRestart, false); 168 results.SetBoolean(flags_ui::kNeedsRestart, false);
169 results.SetBoolean(flags_ui::kShowOwnerWarning, 169 results.SetBoolean(flags_ui::kShowOwnerWarning,
170 access_ == flags_ui::kGeneralAccessFlagsOnly); 170 access_ == flags_ui::kGeneralAccessFlagsOnly);
171 171
172 results.SetBoolean(flags_ui::kShowBetaChannelPromotion, false); 172 results.SetBoolean(flags_ui::kShowBetaChannelPromotion, false);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 /////////////////////////////////////////////////////////////////////////////// 253 ///////////////////////////////////////////////////////////////////////////////
254 // 254 //
255 // AppleFlagsUI 255 // AppleFlagsUI
256 // 256 //
257 /////////////////////////////////////////////////////////////////////////////// 257 ///////////////////////////////////////////////////////////////////////////////
258 258
259 AppleFlagsUI::AppleFlagsUI(web::WebUIIOS* web_ui) 259 AppleFlagsUI::AppleFlagsUI(web::WebUIIOS* web_ui)
260 : BaseFlagsUI(web_ui, BaseFlagsUI::FLAGS_UI_APPLE) {} 260 : BaseFlagsUI(web_ui, BaseFlagsUI::FLAGS_UI_APPLE) {}
261 261
262 AppleFlagsUI::~AppleFlagsUI() {} 262 AppleFlagsUI::~AppleFlagsUI() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698