Chromium Code Reviews| Index: chrome/browser/ui/webui/cloud_print_signin_dialog.cc |
| diff --git a/chrome/browser/ui/webui/cloud_print_signin_dialog.cc b/chrome/browser/ui/webui/cloud_print_signin_dialog.cc |
| index 2379dcba0d0d0698f9bbd45483e95a13e24a10f3..018209d54878fc8fcc47cbd6dac48e18bcb51b3f 100644 |
| --- a/chrome/browser/ui/webui/cloud_print_signin_dialog.cc |
| +++ b/chrome/browser/ui/webui/cloud_print_signin_dialog.cc |
| @@ -14,7 +14,13 @@ |
| #include "chrome/browser/tab_contents/tab_util.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_list.h" |
| +#if defined(USE_AURA) |
| +#include "chrome/browser/ui/browser_window.h" |
| +#endif |
| #include "chrome/browser/ui/dialog_style.h" |
| +#if defined(USE_AURA) |
| +#include "chrome/browser/ui/views/html_dialog_view.h" |
| +#endif |
| #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| #include "chrome/browser/ui/webui/print_preview_ui.h" |
| #include "chrome/common/pref_names.h" |
| @@ -29,7 +35,9 @@ |
| #include "content/public/browser/render_process_host.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_ui_message_handler.h" |
| - |
| +#if defined(USE_AURA) |
| +#include "ui/views/widget/widget.h" |
| +#endif |
| using content::BrowserThread; |
| using content::NavigationController; |
| using content::NavigationEntry; |
| @@ -156,12 +164,12 @@ void CloudPrintSigninDelegate::GetDialogSize(gfx::Size* size) const { |
| BrowserList::GetLastActive()->GetProfile()->GetPrefs(); |
| if (!pref_service->FindPreference(prefs::kCloudPrintSigninDialogWidth)) { |
| pref_service->RegisterIntegerPref(prefs::kCloudPrintSigninDialogWidth, |
| - 800, |
| + 912, |
|
James Hawkins
2012/01/11 17:25:54
Move these into constants, but more likely refacto
|
| PrefService::UNSYNCABLE_PREF); |
| } |
| if (!pref_service->FindPreference(prefs::kCloudPrintSigninDialogHeight)) { |
| pref_service->RegisterIntegerPref(prefs::kCloudPrintSigninDialogHeight, |
| - 600, |
| + 633, |
| PrefService::UNSYNCABLE_PREF); |
| } |
| @@ -198,9 +206,17 @@ void CreateCloudPrintSigninDialogImpl(int render_process_id, |
| return; |
| HtmlDialogUIDelegate* dialog_delegate = |
| new CloudPrintSigninDelegate(parent_tab); |
| - BrowserList::GetLastActive()->BrowserShowHtmlDialog(dialog_delegate, |
| - NULL, |
| - STYLE_GENERIC); |
| + Browser* browser = BrowserList::GetLastActive(); |
| +#if defined(USE_AURA) |
| + HtmlDialogView* html_view = |
|
James Hawkins
2012/01/11 17:25:54
This is the same code as the last file, no? Needs
|
| + new HtmlDialogView(browser->GetProfile(), dialog_delegate); |
| + views::Widget::CreateWindowWithParent(html_view, |
| + browser->window()->GetNativeHandle()); |
| + html_view->InitDialog(); |
| + html_view->GetWidget()->Show(); |
| +#else |
| + browser->BrowserShowHtmlDialog(dialog_delegate, NULL, STYLE_GENERIC); |
| +#endif |
| } |
| void CreateCloudPrintSigninDialog(WebContents* parent_tab) { |