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

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

Issue 2251263003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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/startup_pages_handler.h" 5 #include "chrome/browser/ui/webui/options/startup_pages_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 new CustomHomePagesTableModel(profile)); 103 new CustomHomePagesTableModel(profile));
104 startup_custom_pages_table_model_->SetObserver(this); 104 startup_custom_pages_table_model_->SetObserver(this);
105 105
106 pref_change_registrar_.Init(profile->GetPrefs()); 106 pref_change_registrar_.Init(profile->GetPrefs());
107 pref_change_registrar_.Add( 107 pref_change_registrar_.Add(
108 prefs::kURLsToRestoreOnStartup, 108 prefs::kURLsToRestoreOnStartup,
109 base::Bind(&StartupPagesHandler::UpdateStartupPages, 109 base::Bind(&StartupPagesHandler::UpdateStartupPages,
110 base::Unretained(this))); 110 base::Unretained(this)));
111 111
112 autocomplete_controller_.reset(new AutocompleteController( 112 autocomplete_controller_.reset(new AutocompleteController(
113 base::WrapUnique(new ChromeAutocompleteProviderClient(profile)), this, 113 base::MakeUnique<ChromeAutocompleteProviderClient>(profile), this,
114 AutocompleteClassifier::kDefaultOmniboxProviders)); 114 AutocompleteClassifier::kDefaultOmniboxProviders));
115 } 115 }
116 116
117 void StartupPagesHandler::InitializePage() { 117 void StartupPagesHandler::InitializePage() {
118 UpdateStartupPages(); 118 UpdateStartupPages();
119 } 119 }
120 120
121 void StartupPagesHandler::OnModelChanged() { 121 void StartupPagesHandler::OnModelChanged() {
122 base::ListValue startup_pages; 122 base::ListValue startup_pages;
123 int page_count = startup_custom_pages_table_model_->RowCount(); 123 int page_count = startup_custom_pages_table_model_->RowCount();
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { 263 void StartupPagesHandler::OnResultChanged(bool default_match_changed) {
264 const AutocompleteResult& result = autocomplete_controller_->result(); 264 const AutocompleteResult& result = autocomplete_controller_->result();
265 base::ListValue suggestions; 265 base::ListValue suggestions;
266 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); 266 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions);
267 web_ui()->CallJavascriptFunctionUnsafe( 267 web_ui()->CallJavascriptFunctionUnsafe(
268 "StartupOverlay.updateAutocompleteSuggestions", suggestions); 268 "StartupOverlay.updateAutocompleteSuggestions", suggestions);
269 } 269 }
270 270
271 } // namespace options 271 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/preferences_browsertest.cc ('k') | chrome/browser/ui/webui/policy_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698