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 // Set default resource. |
| 26 source->set_default_resource(IDR_INPUT_WINDOW_DIALOG_HTML); |
| 27 |
| 28 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
| 29 profile->GetChromeURLDataManager()->AddDataSource(source); |
| 30 } |
| 31 |
| 32 InputWindowDialogUI::~InputWindowDialogUI() { |
| 33 } |
OLD | NEW |