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

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

Issue 10909130: autocomplete: Add AutocompleteProvider::Type enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add !! for windows Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/options/home_page_overlay_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
10 #include "chrome/browser/autocomplete/autocomplete_controller.h" 11 #include "chrome/browser/autocomplete/autocomplete_controller.h"
11 #include "chrome/browser/autocomplete/autocomplete_input.h" 12 #include "chrome/browser/autocomplete/autocomplete_input.h"
12 #include "chrome/browser/autocomplete/autocomplete_result.h" 13 #include "chrome/browser/autocomplete/autocomplete_result.h"
13 #include "chrome/browser/custom_home_pages_table_model.h" 14 #include "chrome/browser/custom_home_pages_table_model.h"
14 #include "chrome/browser/net/url_fixer_upper.h" 15 #include "chrome/browser/net/url_fixer_upper.h"
15 #include "chrome/browser/prefs/pref_service.h" 16 #include "chrome/browser/prefs/pref_service.h"
16 #include "chrome/browser/prefs/session_startup_pref.h" 17 #include "chrome/browser/prefs/session_startup_pref.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/common/chrome_notification_types.h" 19 #include "chrome/common/chrome_notification_types.h"
19 #include "chrome/common/pref_names.h" 20 #include "chrome/common/pref_names.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void StartupPagesHandler::InitializeHandler() { 85 void StartupPagesHandler::InitializeHandler() {
85 Profile* profile = Profile::FromWebUI(web_ui()); 86 Profile* profile = Profile::FromWebUI(web_ui());
86 87
87 startup_custom_pages_table_model_.reset( 88 startup_custom_pages_table_model_.reset(
88 new CustomHomePagesTableModel(profile)); 89 new CustomHomePagesTableModel(profile));
89 startup_custom_pages_table_model_->SetObserver(this); 90 startup_custom_pages_table_model_->SetObserver(this);
90 91
91 pref_change_registrar_.Init(profile->GetPrefs()); 92 pref_change_registrar_.Init(profile->GetPrefs());
92 pref_change_registrar_.Add(prefs::kURLsToRestoreOnStartup, this); 93 pref_change_registrar_.Add(prefs::kURLsToRestoreOnStartup, this);
93 94
94 autocomplete_controller_.reset(new AutocompleteController(profile, this)); 95 autocomplete_controller_.reset(new AutocompleteController(profile, this,
96 AutocompleteClassifier::kDefaultOmniboxProviders));
95 } 97 }
96 98
97 void StartupPagesHandler::InitializePage() { 99 void StartupPagesHandler::InitializePage() {
98 UpdateStartupPages(); 100 UpdateStartupPages();
99 } 101 }
100 102
101 void StartupPagesHandler::OnModelChanged() { 103 void StartupPagesHandler::OnModelChanged() {
102 ListValue startup_pages; 104 ListValue startup_pages;
103 int page_count = startup_custom_pages_table_model_->RowCount(); 105 int page_count = startup_custom_pages_table_model_->RowCount();
104 std::vector<GURL> urls = startup_custom_pages_table_model_->GetURLs(); 106 std::vector<GURL> urls = startup_custom_pages_table_model_->GetURLs();
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 253
252 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { 254 void StartupPagesHandler::OnResultChanged(bool default_match_changed) {
253 const AutocompleteResult& result = autocomplete_controller_->result(); 255 const AutocompleteResult& result = autocomplete_controller_->result();
254 ListValue suggestions; 256 ListValue suggestions;
255 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); 257 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions);
256 web_ui()->CallJavascriptFunction( 258 web_ui()->CallJavascriptFunction(
257 "StartupOverlay.updateAutocompleteSuggestions", suggestions); 259 "StartupOverlay.updateAutocompleteSuggestions", suggestions);
258 } 260 }
259 261
260 } // namespace options 262 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/home_page_overlay_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698