| 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/input_window_dialog.h" | 5 #include "chrome/browser/ui/input_window_dialog.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/webui/chrome_web_ui.h" | 8 #include "chrome/browser/ui/webui/chrome_web_ui.h" |
| 9 #include "chrome/browser/ui/webui/input_window_dialog_webui.h" | 9 #include "chrome/browser/ui/webui/input_window_dialog_webui.h" |
| 10 | 10 |
| 11 #if !defined(USE_AURA) | 11 #if !defined(USE_AURA) |
| 12 #include "chrome/browser/ui/input_window_dialog_gtk.h" | 12 #include "chrome/browser/ui/input_window_dialog_gtk.h" |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 InputWindowDialog* InputWindowDialog::Create(gfx::NativeWindow parent, | 15 InputWindowDialog* InputWindowDialog::Create(gfx::NativeWindow parent, |
| 16 const string16& window_title, | 16 const string16& window_title, |
| 17 const string16& label, | 17 const string16& label, |
| 18 const string16& contents, | 18 const string16& contents, |
| 19 Delegate* delegate) { | 19 Delegate* delegate, |
| 20 ButtonType type) { |
| 20 #if defined(USE_AURA) | 21 #if defined(USE_AURA) |
| 21 return new InputWindowDialogWebUI(window_title, | 22 // TODO(tfarina): Implement ButtonType into WebUI dialog too. |
| 22 label, | 23 return new InputWindowDialogWebUI(window_title, label, contents, delegate); |
| 23 contents, | |
| 24 delegate); | |
| 25 #else | 24 #else |
| 26 if (ChromeWebUI::IsMoreWebUI()) { | 25 if (ChromeWebUI::IsMoreWebUI()) { |
| 27 return new InputWindowDialogWebUI(window_title, | 26 // TODO(tfarina): Implement ButtonType into WebUI dialog too. |
| 28 label, | 27 return new InputWindowDialogWebUI(window_title, label, contents, delegate); |
| 29 contents, | |
| 30 delegate); | |
| 31 } else { | 28 } else { |
| 32 return new InputWindowDialogGtk(parent, | 29 return new InputWindowDialogGtk(parent, |
| 33 UTF16ToUTF8(window_title), | 30 UTF16ToUTF8(window_title), |
| 34 UTF16ToUTF8(label), | 31 UTF16ToUTF8(label), |
| 35 UTF16ToUTF8(contents), | 32 UTF16ToUTF8(contents), |
| 36 delegate); | 33 delegate, |
| 34 type); |
| 37 } | 35 } |
| 38 #endif | 36 #endif |
| 39 } | 37 } |
| OLD | NEW |