| 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/chromeos/login/login_html_dialog.h" | 5 #include "chrome/browser/chromeos/login/login_html_dialog.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/frame/bubble_frame_view.h" | 7 #include "chrome/browser/chromeos/frame/bubble_frame_view.h" |
| 8 #include "chrome/browser/chromeos/frame/bubble_window.h" | 8 #include "chrome/browser/chromeos/frame/bubble_window.h" |
| 9 #include "chrome/browser/chromeos/login/helper.h" | 9 #include "chrome/browser/chromeos/login/helper.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 static_cast<BubbleWindow::Style>( | 57 static_cast<BubbleWindow::Style>( |
| 58 BubbleWindow::STYLE_XBAR | BubbleWindow::STYLE_THROBBER), | 58 BubbleWindow::STYLE_XBAR | BubbleWindow::STYLE_THROBBER), |
| 59 html_view); | 59 html_view); |
| 60 bubble_frame_view_ = static_cast<BubbleFrameView*>( | 60 bubble_frame_view_ = static_cast<BubbleFrameView*>( |
| 61 bubble_window->non_client_view()->frame_view()); | 61 bubble_window->non_client_view()->frame_view()); |
| 62 } else { | 62 } else { |
| 63 views::Widget::CreateWindowWithParent(html_view, parent_window_); | 63 views::Widget::CreateWindowWithParent(html_view, parent_window_); |
| 64 } | 64 } |
| 65 if (bubble_frame_view_) { | 65 if (bubble_frame_view_) { |
| 66 bubble_frame_view_->StartThrobber(); | 66 bubble_frame_view_->StartThrobber(); |
| 67 notification_registrar_.Add(this, | 67 notification_registrar_.Add( |
| 68 NotificationType::LOAD_COMPLETED_MAIN_FRAME, | 68 this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| 69 NotificationService::AllSources()); | 69 NotificationService::AllSources()); |
| 70 } | 70 } |
| 71 html_view->InitDialog(); | 71 html_view->InitDialog(); |
| 72 html_view->GetWidget()->Show(); | 72 html_view->GetWidget()->Show(); |
| 73 is_open_ = true; | 73 is_open_ = true; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void LoginHtmlDialog::SetDialogSize(int width, int height) { | 76 void LoginHtmlDialog::SetDialogSize(int width, int height) { |
| 77 DCHECK(width >= 0 && height >= 0); | 77 DCHECK(width >= 0 && height >= 0); |
| 78 width_ = width; | 78 width_ = width; |
| 79 height_ = height; | 79 height_ = height; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 bool LoginHtmlDialog::ShouldShowDialogTitle() const { | 122 bool LoginHtmlDialog::ShouldShowDialogTitle() const { |
| 123 return true; | 123 return true; |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool LoginHtmlDialog::HandleContextMenu(const ContextMenuParams& params) { | 126 bool LoginHtmlDialog::HandleContextMenu(const ContextMenuParams& params) { |
| 127 // Disable context menu. | 127 // Disable context menu. |
| 128 return true; | 128 return true; |
| 129 } | 129 } |
| 130 | 130 |
| 131 void LoginHtmlDialog::Observe(NotificationType type, | 131 void LoginHtmlDialog::Observe(int type, |
| 132 const NotificationSource& source, | 132 const NotificationSource& source, |
| 133 const NotificationDetails& details) { | 133 const NotificationDetails& details) { |
| 134 DCHECK(type.value == NotificationType::LOAD_COMPLETED_MAIN_FRAME); | 134 DCHECK(type == content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); |
| 135 if (bubble_frame_view_) | 135 if (bubble_frame_view_) |
| 136 bubble_frame_view_->StopThrobber(); | 136 bubble_frame_view_->StopThrobber(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace chromeos | 139 } // namespace chromeos |
| OLD | NEW |