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/edit_search_engine_dialog_webui.h" | 5 #include "chrome/browser/ui/webui/edit_search_engine_dialog_webui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/search_engines/template_url.h" | 15 #include "chrome/browser/search_engines/template_url.h" |
16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/browser_list.h" | 17 #include "chrome/browser/ui/browser_list.h" |
18 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" | 18 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" |
19 #include "chrome/browser/ui/webui/theme_source.h" | 19 #include "chrome/browser/ui/webui/theme_source.h" |
20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
21 #include "grit/ui_resources.h" | 21 #include "grit/ui_resources.h" |
22 #include "grit/theme_resources.h" | 22 #include "grit/theme_resources.h" |
23 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
25 | 25 |
26 namespace { | 26 namespace { |
27 const int kEditSearchEngineDialogWidth = 394; | 27 const int kEditSearchEngineDialogWidth = 440; |
28 const int kEditSearchEngineDialogHeight = 180; | 28 const int kEditSearchEngineDialogHeight = 196; |
29 } | 29 } |
30 | 30 |
31 //////////////////////////////////////////////////////////////////////////////// | 31 //////////////////////////////////////////////////////////////////////////////// |
32 // Browser dialog API implementation | 32 // Browser dialog API implementation |
33 | 33 |
34 namespace browser { | 34 namespace browser { |
35 void ConfirmAddSearchProvider(const TemplateURL* template_url, | 35 void ConfirmAddSearchProvider(const TemplateURL* template_url, |
36 Profile* profile) { | 36 Profile* profile) { |
37 EditSearchEngineDialogWebUI::ShowEditSearchEngineDialog(template_url, | 37 EditSearchEngineDialogWebUI::ShowEditSearchEngineDialog(template_url, |
38 profile); | 38 profile); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 dict->GetString("keyword", &keyword_str) && | 183 dict->GetString("keyword", &keyword_str) && |
184 dict->GetString("url", &url_str)) { | 184 dict->GetString("url", &url_str)) { |
185 controller_->AcceptAddOrEdit(description_str, | 185 controller_->AcceptAddOrEdit(description_str, |
186 keyword_str, | 186 keyword_str, |
187 url_str); | 187 url_str); |
188 } else { | 188 } else { |
189 controller_->CleanUpCancelledAdd(); | 189 controller_->CleanUpCancelledAdd(); |
190 } | 190 } |
191 } | 191 } |
192 } | 192 } |
OLD | NEW |