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/options2/startup_pages_handler.h" | 5 #include "chrome/browser/ui/webui/options2/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_controller.h" | 10 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 void StartupPagesHandler::DragDropStartupPage(const ListValue* args) { | 198 void StartupPagesHandler::DragDropStartupPage(const ListValue* args) { |
199 CHECK_EQ(args->GetSize(), 2U); | 199 CHECK_EQ(args->GetSize(), 2U); |
200 | 200 |
201 std::string value; | 201 std::string value; |
202 int to_index; | 202 int to_index; |
203 | 203 |
204 CHECK(args->GetString(0, &value)); | 204 CHECK(args->GetString(0, &value)); |
205 base::StringToInt(value, &to_index); | 205 base::StringToInt(value, &to_index); |
206 | 206 |
207 ListValue* selected; | 207 const ListValue* selected; |
208 CHECK(args->GetList(1, &selected)); | 208 CHECK(args->GetList(1, &selected)); |
209 | 209 |
210 std::vector<int> index_list; | 210 std::vector<int> index_list; |
211 for (size_t i = 0; i < selected->GetSize(); ++i) { | 211 for (size_t i = 0; i < selected->GetSize(); ++i) { |
212 int index; | 212 int index; |
213 CHECK(selected->GetString(i, &value)); | 213 CHECK(selected->GetString(i, &value)); |
214 base::StringToInt(value, &index); | 214 base::StringToInt(value, &index); |
215 index_list.push_back(index); | 215 index_list.push_back(index); |
216 } | 216 } |
217 | 217 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { | 251 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { |
252 const AutocompleteResult& result = autocomplete_controller_->result(); | 252 const AutocompleteResult& result = autocomplete_controller_->result(); |
253 ListValue suggestions; | 253 ListValue suggestions; |
254 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); | 254 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); |
255 web_ui()->CallJavascriptFunction( | 255 web_ui()->CallJavascriptFunction( |
256 "StartupOverlay.updateAutocompleteSuggestions", suggestions); | 256 "StartupOverlay.updateAutocompleteSuggestions", suggestions); |
257 } | 257 } |
258 | 258 |
259 } // namespace options2 | 259 } // namespace options2 |
OLD | NEW |