| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/search_engine_manager_handler.h" | 5 #include "chrome/browser/ui/webui/options/search_engine_manager_handler.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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 int engine_count = list_controller_->table_model()->RowCount(); | 136 int engine_count = list_controller_->table_model()->RowCount(); |
| 137 for (int i = last_default_engine_index; i < engine_count; ++i) { | 137 for (int i = last_default_engine_index; i < engine_count; ++i) { |
| 138 others_list.Append(CreateDictionaryForEngine(i, i == default_index)); | 138 others_list.Append(CreateDictionaryForEngine(i, i == default_index)); |
| 139 } | 139 } |
| 140 | 140 |
| 141 // Build the extension keywords list. | 141 // Build the extension keywords list. |
| 142 ListValue keyword_list; | 142 ListValue keyword_list; |
| 143 ExtensionService* extension_service = | 143 ExtensionService* extension_service = |
| 144 Profile::FromWebUI(web_ui_)->GetExtensionService(); | 144 Profile::FromWebUI(web_ui_)->GetExtensionService(); |
| 145 if (extension_service) { | 145 if (extension_service) { |
| 146 const ExtensionList* extensions = extension_service->extensions(); | 146 const ExtensionSet* extensions = extension_service->extensions(); |
| 147 for (ExtensionList::const_iterator it = extensions->begin(); | 147 for (ExtensionSet::const_iterator it = extensions->begin(); |
| 148 it != extensions->end(); ++it) { | 148 it != extensions->end(); ++it) { |
| 149 if ((*it)->omnibox_keyword().size() > 0) | 149 if ((*it)->omnibox_keyword().size() > 0) |
| 150 keyword_list.Append(CreateDictionaryForExtension(*(*it))); | 150 keyword_list.Append(CreateDictionaryForExtension(*(*it))); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 web_ui_->CallJavascriptFunction("SearchEngineManager.updateSearchEngineList", | 154 web_ui_->CallJavascriptFunction("SearchEngineManager.updateSearchEngineList", |
| 155 defaults_list, others_list, keyword_list); | 155 defaults_list, others_list, keyword_list); |
| 156 } | 156 } |
| 157 | 157 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 string16 keyword; | 304 string16 keyword; |
| 305 std::string url; | 305 std::string url; |
| 306 if (!args->GetString(ENGINE_NAME, &name) || | 306 if (!args->GetString(ENGINE_NAME, &name) || |
| 307 !args->GetString(ENGINE_KEYWORD, &keyword) || | 307 !args->GetString(ENGINE_KEYWORD, &keyword) || |
| 308 !args->GetString(ENGINE_URL, &url)) { | 308 !args->GetString(ENGINE_URL, &url)) { |
| 309 NOTREACHED(); | 309 NOTREACHED(); |
| 310 return; | 310 return; |
| 311 } | 311 } |
| 312 edit_controller_->AcceptAddOrEdit(name, keyword, url); | 312 edit_controller_->AcceptAddOrEdit(name, keyword, url); |
| 313 } | 313 } |
| OLD | NEW |