| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |