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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 void SearchEngineManagerHandler::OnItemsAdded(int start, int length) { | 160 void SearchEngineManagerHandler::OnItemsAdded(int start, int length) { |
161 OnModelChanged(); | 161 OnModelChanged(); |
162 } | 162 } |
163 | 163 |
164 void SearchEngineManagerHandler::OnItemsRemoved(int start, int length) { | 164 void SearchEngineManagerHandler::OnItemsRemoved(int start, int length) { |
165 OnModelChanged(); | 165 OnModelChanged(); |
166 } | 166 } |
167 | 167 |
168 base::DictionaryValue* SearchEngineManagerHandler::CreateDictionaryForExtension( | 168 base::DictionaryValue* SearchEngineManagerHandler::CreateDictionaryForExtension( |
169 const Extension& extension) { | 169 const extensions::Extension& extension) { |
170 base::DictionaryValue* dict = new base::DictionaryValue(); | 170 base::DictionaryValue* dict = new base::DictionaryValue(); |
171 dict->SetString("name", extension.name()); | 171 dict->SetString("name", extension.name()); |
172 dict->SetString("displayName", extension.name()); | 172 dict->SetString("displayName", extension.name()); |
173 dict->SetString("keyword", extension.omnibox_keyword()); | 173 dict->SetString("keyword", extension.omnibox_keyword()); |
174 GURL icon = extension.GetIconURL(16, ExtensionIconSet::MATCH_BIGGER); | 174 GURL icon = extension.GetIconURL(16, ExtensionIconSet::MATCH_BIGGER); |
175 dict->SetString("iconURL", icon.spec()); | 175 dict->SetString("iconURL", icon.spec()); |
176 dict->SetString("url", string16()); | 176 dict->SetString("url", string16()); |
177 return dict; | 177 return dict; |
178 } | 178 } |
179 | 179 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 308 } |
309 // Recheck validity. It's possible to get here with invalid input if e.g. the | 309 // Recheck validity. It's possible to get here with invalid input if e.g. the |
310 // user calls the right JS functions directly from the web inspector. | 310 // user calls the right JS functions directly from the web inspector. |
311 if (edit_controller_->IsTitleValid(name) && | 311 if (edit_controller_->IsTitleValid(name) && |
312 edit_controller_->IsKeywordValid(keyword) && | 312 edit_controller_->IsKeywordValid(keyword) && |
313 edit_controller_->IsURLValid(url)) | 313 edit_controller_->IsURLValid(url)) |
314 edit_controller_->AcceptAddOrEdit(name, keyword, url); | 314 edit_controller_->AcceptAddOrEdit(name, keyword, url); |
315 } | 315 } |
316 | 316 |
317 } // namespace options2 | 317 } // namespace options2 |
OLD | NEW |