| 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/input_window_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 InputWindowDialogUI::InputWindowDialogUI(TabContents* contents) |
| 15 : HtmlDialogUI(contents) { |
| 16 ChromeWebUIDataSource* source = |
| 17 new ChromeWebUIDataSource(chrome::kChromeUIInputWindowDialogHost); |
| 18 |
| 19 source->AddLocalizedString("ok", IDS_OK); |
| 20 source->AddLocalizedString("cancel", IDS_CANCEL); |
| 21 |
| 22 // Set the json path. |
| 23 source->set_json_path("strings.js"); |
| 24 |
| 25 // Add required resources. |
| 26 source->add_resource_path("input_window_dialog.js", |
| 27 IDR_INPUT_WINDOW_DIALOG_JS); |
| 28 source->add_resource_path("input_window_dialog.css", |
| 29 IDR_INPUT_WINDOW_DIALOG_CSS); |
| 30 |
| 31 // Set default resource. |
| 32 source->set_default_resource(IDR_INPUT_WINDOW_DIALOG_HTML); |
| 33 |
| 34 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
| 35 profile->GetChromeURLDataManager()->AddDataSource(source); |
| 36 } |
| 37 |
| 38 InputWindowDialogUI::~InputWindowDialogUI() { |
| 39 } |
| OLD | NEW |