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

Side by Side Diff: chrome/browser/ui/webui/options/autofill_options_handler.cc

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: No ListValue::SetDouble 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/options/autofill_options_handler.h" 5 #include "chrome/browser/ui/webui/options/autofill_options_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 NOTREACHED(); 283 NOTREACHED();
284 return; 284 return;
285 } 285 }
286 286
287 base::DictionaryValue input; 287 base::DictionaryValue input;
288 std::unique_ptr<base::ListValue> components(new base::ListValue); 288 std::unique_ptr<base::ListValue> components(new base::ListValue);
289 std::string language_code; 289 std::string language_code;
290 autofill::GetAddressComponents(country_code, 290 autofill::GetAddressComponents(country_code,
291 g_browser_process->GetApplicationLocale(), 291 g_browser_process->GetApplicationLocale(),
292 components.get(), &language_code); 292 components.get(), &language_code);
293 input.Set(kComponents, components.release()); 293 input.Set(kComponents, std::move(components));
294 input.SetString(kLanguageCode, language_code); 294 input.SetString(kLanguageCode, language_code);
295 295
296 web_ui()->CallJavascriptFunctionUnsafe( 296 web_ui()->CallJavascriptFunctionUnsafe(
297 "AutofillEditAddressOverlay.loadAddressComponents", input); 297 "AutofillEditAddressOverlay.loadAddressComponents", input);
298 } 298 }
299 299
300 void AutofillOptionsHandler::LoadCreditCardEditor(const base::ListValue* args) { 300 void AutofillOptionsHandler::LoadCreditCardEditor(const base::ListValue* args) {
301 DCHECK(IsPersonalDataLoaded()); 301 DCHECK(IsPersonalDataLoaded());
302 302
303 std::string guid; 303 std::string guid;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)); 494 profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY));
495 address->SetString("phone", 495 address->SetString("phone",
496 profile.GetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER)); 496 profile.GetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER));
497 address->SetString("email", profile.GetRawInfo(autofill::EMAIL_ADDRESS)); 497 address->SetString("email", profile.GetRawInfo(autofill::EMAIL_ADDRESS));
498 address->SetString(kLanguageCode, profile.language_code()); 498 address->SetString(kLanguageCode, profile.language_code());
499 499
500 std::unique_ptr<base::ListValue> components(new base::ListValue); 500 std::unique_ptr<base::ListValue> components(new base::ListValue);
501 autofill::GetAddressComponents( 501 autofill::GetAddressComponents(
502 base::UTF16ToUTF8(profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)), 502 base::UTF16ToUTF8(profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)),
503 profile.language_code(), components.get(), nullptr); 503 profile.language_code(), components.get(), nullptr);
504 address->Set(kComponents, components.release()); 504 address->Set(kComponents, std::move(components));
505 } 505 }
506 506
507 } // namespace options 507 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.cc ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698