| 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/search_engine_manager_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/search_engine_manager_handler2.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 int index, bool is_default) { | 189 int index, bool is_default) { |
| 190 TemplateURLTableModel* table_model = list_controller_->table_model(); | 190 TemplateURLTableModel* table_model = list_controller_->table_model(); |
| 191 const TemplateURL* template_url = list_controller_->GetTemplateURL(index); | 191 const TemplateURL* template_url = list_controller_->GetTemplateURL(index); |
| 192 | 192 |
| 193 base::DictionaryValue* dict = new base::DictionaryValue(); | 193 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 194 dict->SetString("name", template_url->short_name()); | 194 dict->SetString("name", template_url->short_name()); |
| 195 dict->SetString("displayName", table_model->GetText( | 195 dict->SetString("displayName", table_model->GetText( |
| 196 index, IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN)); | 196 index, IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN)); |
| 197 dict->SetString("keyword", table_model->GetText( | 197 dict->SetString("keyword", table_model->GetText( |
| 198 index, IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN)); | 198 index, IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN)); |
| 199 dict->SetString("url", template_url->url()->DisplayURL()); | 199 dict->SetString("url", template_url->url_ref().DisplayURL()); |
| 200 dict->SetBoolean("urlLocked", template_url->prepopulate_id() > 0); | 200 dict->SetBoolean("urlLocked", template_url->prepopulate_id() > 0); |
| 201 GURL icon_url = template_url->favicon_url(); | 201 GURL icon_url = template_url->favicon_url(); |
| 202 if (icon_url.is_valid()) | 202 if (icon_url.is_valid()) |
| 203 dict->SetString("iconURL", icon_url.spec()); | 203 dict->SetString("iconURL", icon_url.spec()); |
| 204 dict->SetString("modelIndex", base::IntToString(index)); | 204 dict->SetString("modelIndex", base::IntToString(index)); |
| 205 | 205 |
| 206 if (list_controller_->CanRemove(template_url)) | 206 if (list_controller_->CanRemove(template_url)) |
| 207 dict->SetString("canBeRemoved", "1"); | 207 dict->SetString("canBeRemoved", "1"); |
| 208 if (list_controller_->CanMakeDefault(template_url)) | 208 if (list_controller_->CanMakeDefault(template_url)) |
| 209 dict->SetString("canBeDefault", "1"); | 209 dict->SetString("canBeDefault", "1"); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 if (!args->GetString(ENGINE_NAME, &name) || | 309 if (!args->GetString(ENGINE_NAME, &name) || |
| 310 !args->GetString(ENGINE_KEYWORD, &keyword) || | 310 !args->GetString(ENGINE_KEYWORD, &keyword) || |
| 311 !args->GetString(ENGINE_URL, &url)) { | 311 !args->GetString(ENGINE_URL, &url)) { |
| 312 NOTREACHED(); | 312 NOTREACHED(); |
| 313 return; | 313 return; |
| 314 } | 314 } |
| 315 edit_controller_->AcceptAddOrEdit(name, keyword, url); | 315 edit_controller_->AcceptAddOrEdit(name, keyword, url); |
| 316 } | 316 } |
| 317 | 317 |
| 318 } // namespace options2 | 318 } // namespace options2 |
| OLD | NEW |