| 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_ui_webui.h" | 5 #include "chrome/browser/ui/webui/edit_search_engine_dialog_ui_webui.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" |
| 7 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 8 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 8 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 9 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 10 #include "chrome/browser/profiles/profile.h" | |
| 11 #include "grit/browser_resources.h" | 11 #include "grit/browser_resources.h" |
| 12 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 13 | 13 |
| 14 EditSearchEngineDialogUI::EditSearchEngineDialogUI(TabContents* contents) | 14 using content::WebContents; |
| 15 |
| 16 EditSearchEngineDialogUI::EditSearchEngineDialogUI(WebContents* contents) |
| 15 : HtmlDialogUI(contents) { | 17 : HtmlDialogUI(contents) { |
| 16 ChromeWebUIDataSource* source = | 18 ChromeWebUIDataSource* source = |
| 17 new ChromeWebUIDataSource(chrome::kChromeUIEditSearchEngineDialogHost); | 19 new ChromeWebUIDataSource(chrome::kChromeUIEditSearchEngineDialogHost); |
| 18 | 20 |
| 19 source->AddLocalizedString("titleNew", | 21 source->AddLocalizedString("titleNew", |
| 20 IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE); | 22 IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE); |
| 21 source->AddLocalizedString("titleEdit", | 23 source->AddLocalizedString("titleEdit", |
| 22 IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE); | 24 IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE); |
| 23 source->AddLocalizedString("descriptionLabel", | 25 source->AddLocalizedString("descriptionLabel", |
| 24 IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_LABEL); | 26 IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_LABEL); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 46 | 48 |
| 47 // Set default resource. | 49 // Set default resource. |
| 48 source->set_default_resource(IDR_EDIT_SEARCH_ENGINE_DIALOG_HTML); | 50 source->set_default_resource(IDR_EDIT_SEARCH_ENGINE_DIALOG_HTML); |
| 49 | 51 |
| 50 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); | 52 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); |
| 51 profile->GetChromeURLDataManager()->AddDataSource(source); | 53 profile->GetChromeURLDataManager()->AddDataSource(source); |
| 52 } | 54 } |
| 53 | 55 |
| 54 EditSearchEngineDialogUI::~EditSearchEngineDialogUI() { | 56 EditSearchEngineDialogUI::~EditSearchEngineDialogUI() { |
| 55 } | 57 } |
| OLD | NEW |