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/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/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 TemplateURL::Type type = template_url->type(); | 200 TemplateURL::Type type = template_url->type(); |
201 dict->SetBoolean("isOmniboxExtension", | 201 dict->SetBoolean("isOmniboxExtension", |
202 type == TemplateURL::OMNIBOX_API_EXTENSION); | 202 type == TemplateURL::OMNIBOX_API_EXTENSION); |
203 if (type == TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION || | 203 if (type == TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION || |
204 type == TemplateURL::OMNIBOX_API_EXTENSION) { | 204 type == TemplateURL::OMNIBOX_API_EXTENSION) { |
205 const extensions::Extension* extension = | 205 const extensions::Extension* extension = |
206 extensions::ExtensionRegistry::Get(Profile::FromWebUI(web_ui())) | 206 extensions::ExtensionRegistry::Get(Profile::FromWebUI(web_ui())) |
207 ->GetExtensionById(template_url->GetExtensionId(), | 207 ->GetExtensionById(template_url->GetExtensionId(), |
208 extensions::ExtensionRegistry::EVERYTHING); | 208 extensions::ExtensionRegistry::EVERYTHING); |
209 if (extension) { | 209 if (extension) { |
210 dict->Set("extension", extensions::util::GetExtensionInfo(extension)); | 210 dict->Set("extension", |
| 211 extensions::util::GetExtensionInfo(extension).release()); |
211 } | 212 } |
212 } | 213 } |
213 return dict; | 214 return dict; |
214 } | 215 } |
215 | 216 |
216 void SearchEngineManagerHandler::SetDefaultSearchEngine( | 217 void SearchEngineManagerHandler::SetDefaultSearchEngine( |
217 const base::ListValue* args) { | 218 const base::ListValue* args) { |
218 int index; | 219 int index; |
219 if (!ExtractIntegerValue(args, &index)) { | 220 if (!ExtractIntegerValue(args, &index)) { |
220 NOTREACHED(); | 221 NOTREACHED(); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 | 321 |
321 // Recheck validity. It's possible to get here with invalid input if e.g. the | 322 // Recheck validity. It's possible to get here with invalid input if e.g. the |
322 // user calls the right JS functions directly from the web inspector. | 323 // user calls the right JS functions directly from the web inspector. |
323 if (edit_controller_->IsTitleValid(name) && | 324 if (edit_controller_->IsTitleValid(name) && |
324 edit_controller_->IsKeywordValid(keyword) && | 325 edit_controller_->IsKeywordValid(keyword) && |
325 edit_controller_->IsURLValid(url)) | 326 edit_controller_->IsURLValid(url)) |
326 edit_controller_->AcceptAddOrEdit(name, keyword, url); | 327 edit_controller_->AcceptAddOrEdit(name, keyword, url); |
327 } | 328 } |
328 | 329 |
329 } // namespace options | 330 } // namespace options |
OLD | NEW |