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

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

Issue 657333002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/policy_ui.h" 5 #include "chrome/browser/ui/webui/policy_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 base::JSONWriter::OPTIONS_PRETTY_PRINT, 213 base::JSONWriter::OPTIONS_PRETTY_PRINT,
214 &json_string); 214 &json_string);
215 return make_scoped_ptr(new base::StringValue(json_string)); 215 return make_scoped_ptr(new base::StringValue(json_string));
216 } 216 }
217 217
218 // Returns a copy of |value| with some values converted to a representation that 218 // Returns a copy of |value| with some values converted to a representation that
219 // i18n_template.js will display in a nicer way. 219 // i18n_template.js will display in a nicer way.
220 scoped_ptr<base::Value> CopyAndConvert(const base::Value* value) { 220 scoped_ptr<base::Value> CopyAndConvert(const base::Value* value) {
221 const base::DictionaryValue* dict = NULL; 221 const base::DictionaryValue* dict = NULL;
222 if (value->GetAsDictionary(&dict)) 222 if (value->GetAsDictionary(&dict))
223 return DictionaryToJSONString(dict).PassAs<base::Value>(); 223 return DictionaryToJSONString(dict);
224 224
225 scoped_ptr<base::Value> copy(value->DeepCopy()); 225 scoped_ptr<base::Value> copy(value->DeepCopy());
226 base::ListValue* list = NULL; 226 base::ListValue* list = NULL;
227 if (copy->GetAsList(&list)) { 227 if (copy->GetAsList(&list)) {
228 for (size_t i = 0; i < list->GetSize(); ++i) { 228 for (size_t i = 0; i < list->GetSize(); ++i) {
229 if (list->GetDictionary(i, &dict)) 229 if (list->GetDictionary(i, &dict))
230 list->Set(i, DictionaryToJSONString(dict).release()); 230 list->Set(i, DictionaryToJSONString(dict).release());
231 } 231 }
232 } 232 }
233 233
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 } 788 }
789 789
790 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) { 790 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) {
791 web_ui->AddMessageHandler(new PolicyUIHandler); 791 web_ui->AddMessageHandler(new PolicyUIHandler);
792 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), 792 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui),
793 CreatePolicyUIHTMLSource()); 793 CreatePolicyUIHTMLSource());
794 } 794 }
795 795
796 PolicyUI::~PolicyUI() { 796 PolicyUI::~PolicyUI() {
797 } 797 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698