Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/webui/edit_search_engine_dialog_ui.h" | |
| 6 | |
| 7 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | |
| 8 #include "chrome/common/url_constants.h" | |
| 9 #include "content/browser/tab_contents/tab_contents.h" | |
| 10 #include "chrome/browser/profiles/profile.h" | |
| 11 #include "grit/browser_resources.h" | |
| 12 #include "grit/generated_resources.h" | |
| 13 | |
| 14 EditSearchEngineDialogUI::EditSearchEngineDialogUI(TabContents* contents) | |
| 15 : HtmlDialogUI(contents) { | |
| 16 ChromeWebUIDataSource* source = | |
| 17 new ChromeWebUIDataSource(chrome::kChromeUIEditSearchEngineDialogHost); | |
| 18 | |
| 19 source->AddLocalizedString("titleNew", | |
| 20 IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE); | |
| 21 source->AddLocalizedString("titleEdit", | |
| 22 IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE); | |
| 23 source->AddLocalizedString("description-label", | |
|
arv (Not doing code reviews)
2011/10/04 20:55:01
descriptionLabel
http://dev.chromium.org/develope
wyck
2011/10/04 21:57:57
Done.
| |
| 24 IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_LABEL); | |
| 25 source->AddLocalizedString("keyword-label", | |
| 26 IDS_SEARCH_ENGINES_EDITOR_KEYWORD_LABEL); | |
| 27 source->AddLocalizedString("url-label", IDS_SEARCH_ENGINES_EDITOR_URL_LABEL); | |
| 28 source->AddLocalizedString("url-description-label", | |
| 29 IDS_SEARCH_ENGINES_EDITOR_URL_DESCRIPTION_LABEL); | |
| 30 source->AddLocalizedString("invalid-title", | |
| 31 IDS_SEARCH_ENGINES_INVALID_TITLE_TT); | |
| 32 source->AddLocalizedString("invalid-keyword", | |
| 33 IDS_SEARCH_ENGINES_INVALID_KEYWORD_TT); | |
| 34 source->AddLocalizedString("invalid-url", IDS_SEARCH_ENGINES_INVALID_URL_TT); | |
| 35 source->AddLocalizedString("cancel", IDS_CANCEL); | |
| 36 source->AddLocalizedString("save", IDS_SAVE); | |
| 37 | |
| 38 // Set the json path. | |
| 39 source->set_json_path("strings.js"); | |
| 40 | |
| 41 // Add required resources. | |
| 42 source->add_resource_path("edit_search_engine_dialog.js", | |
| 43 IDR_EDIT_SEARCH_ENGINE_DIALOG_JS); | |
| 44 source->add_resource_path("edit_search_engine_dialog.css", | |
| 45 IDR_EDIT_SEARCH_ENGINE_DIALOG_CSS); | |
| 46 | |
| 47 // Set default resource. | |
| 48 source->set_default_resource(IDR_EDIT_SEARCH_ENGINE_DIALOG_HTML); | |
| 49 | |
| 50 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); | |
| 51 profile->GetChromeURLDataManager()->AddDataSource(source); | |
| 52 } | |
| 53 | |
| 54 EditSearchEngineDialogUI::~EditSearchEngineDialogUI() { | |
| 55 } | |
| OLD | NEW |