| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 void StartupPagesHandler::DragDropStartupPage(const base::ListValue* args) { | 211 void StartupPagesHandler::DragDropStartupPage(const base::ListValue* args) { |
| 212 CHECK_EQ(args->GetSize(), 2U); | 212 CHECK_EQ(args->GetSize(), 2U); |
| 213 | 213 |
| 214 int to_index; | 214 int to_index; |
| 215 | 215 |
| 216 CHECK(args->GetInteger(0, &to_index)); | 216 CHECK(args->GetInteger(0, &to_index)); |
| 217 | 217 |
| 218 const base::ListValue* selected; | 218 const base::ListValue* selected = |
| 219 CHECK(args->GetList(1, &selected)); | 219 static_cast<const base::ListValue*>(&args->base::Value::GetList()[1]); |
| 220 | 220 |
| 221 std::vector<int> index_list; | 221 std::vector<int> index_list; |
| 222 for (size_t i = 0; i < selected->GetSize(); ++i) { | 222 for (size_t i = 0; i < selected->GetSize(); ++i) { |
| 223 int index; | 223 int index; |
| 224 CHECK(selected->GetInteger(i, &index)); | 224 CHECK(selected->GetInteger(i, &index)); |
| 225 index_list.push_back(index); | 225 index_list.push_back(index); |
| 226 } | 226 } |
| 227 | 227 |
| 228 startup_custom_pages_table_model_->MoveURLs(to_index, index_list); | 228 startup_custom_pages_table_model_->MoveURLs(to_index, index_list); |
| 229 } | 229 } |
| (...skipping 32 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 |