OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/login_web_dialog.h" | 5 #include "chrome/browser/chromeos/login/login_web_dialog.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/chromeos/login/helper.h" | 8 #include "chrome/browser/chromeos/login/helper.h" |
9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
10 #include "chrome/browser/ui/views/web_dialog_view.h" | 10 #include "chrome/browser/ui/browser_dialogs.h" |
11 #include "content/public/browser/notification_source.h" | 11 #include "content/public/browser/notification_source.h" |
12 #include "content/public/browser/notification_types.h" | 12 #include "content/public/browser/notification_types.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
17 | 17 |
18 using content::WebContents; | 18 using content::WebContents; |
19 using content::WebUIMessageHandler; | 19 using content::WebUIMessageHandler; |
20 | 20 |
(...skipping 28 matching lines...) Expand all Loading... |
49 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); | 49 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); |
50 width_ = static_cast<int>(kDefaultWidthRatio * screen_bounds.width()); | 50 width_ = static_cast<int>(kDefaultWidthRatio * screen_bounds.width()); |
51 height_ = static_cast<int>(kDefaultHeightRatio * screen_bounds.height()); | 51 height_ = static_cast<int>(kDefaultHeightRatio * screen_bounds.height()); |
52 } | 52 } |
53 | 53 |
54 LoginWebDialog::~LoginWebDialog() { | 54 LoginWebDialog::~LoginWebDialog() { |
55 delegate_ = NULL; | 55 delegate_ = NULL; |
56 } | 56 } |
57 | 57 |
58 void LoginWebDialog::Show() { | 58 void LoginWebDialog::Show() { |
59 views::Widget::CreateWindowWithParent( | 59 chrome::ShowWebDialog(parent_window_, |
60 new WebDialogView(ProfileManager::GetDefaultProfile(), this), | 60 ProfileManager::GetDefaultProfile(), |
61 parent_window_)->Show(); | 61 this); |
62 is_open_ = true; | 62 is_open_ = true; |
63 } | 63 } |
64 | 64 |
65 void LoginWebDialog::SetDialogSize(int width, int height) { | 65 void LoginWebDialog::SetDialogSize(int width, int height) { |
66 DCHECK(width >= 0 && height >= 0); | 66 DCHECK(width >= 0 && height >= 0); |
67 width_ = width; | 67 width_ = width; |
68 height_ = height; | 68 height_ = height; |
69 } | 69 } |
70 | 70 |
71 void LoginWebDialog::SetDialogTitle(const string16& title) { | 71 void LoginWebDialog::SetDialogTitle(const string16& title) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 void LoginWebDialog::Observe(int type, | 125 void LoginWebDialog::Observe(int type, |
126 const content::NotificationSource& source, | 126 const content::NotificationSource& source, |
127 const content::NotificationDetails& details) { | 127 const content::NotificationDetails& details) { |
128 DCHECK(type == content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); | 128 DCHECK(type == content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); |
129 // TODO(saintlou): Do we need a throbber for Aura? | 129 // TODO(saintlou): Do we need a throbber for Aura? |
130 NOTIMPLEMENTED(); | 130 NOTIMPLEMENTED(); |
131 } | 131 } |
132 | 132 |
133 } // namespace chromeos | 133 } // namespace chromeos |
OLD | NEW |