Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1078)

Unified Diff: chrome/browser/chromeos/login/login_html_dialog.cc

Issue 8774022: Converting BubbleWindow uses, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Doesn't build... just a checkpoint for this work, might change approach. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/login_html_dialog.cc
diff --git a/chrome/browser/chromeos/login/login_html_dialog.cc b/chrome/browser/chromeos/login/login_html_dialog.cc
index 59f175270275c55c0d357ddc2b627f14a13ea5e9..9426ba3db6c0ea45b2cf20d0776aceae67b947ec 100644
--- a/chrome/browser/chromeos/login/login_html_dialog.cc
+++ b/chrome/browser/chromeos/login/login_html_dialog.cc
@@ -5,17 +5,11 @@
#include "chrome/browser/chromeos/login/login_html_dialog.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/chromeos/frame/bubble_frame_view.h"
-#include "chrome/browser/chromeos/frame/bubble_window.h"
#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/views/html_dialog_view.h"
-#include "content/public/browser/notification_source.h"
-#include "content/public/browser/notification_types.h"
-#include "ui/gfx/native_widget_types.h"
-#include "ui/gfx/rect.h"
-#include "ui/gfx/size.h"
-#include "ui/views/widget/widget.h"
+#include "chrome/browser/ui/views/window.h"
namespace chromeos {
@@ -36,14 +30,11 @@ void LoginHtmlDialog::Delegate::OnDialogClosed() {
LoginHtmlDialog::LoginHtmlDialog(Delegate* delegate,
gfx::NativeWindow parent_window,
const std::wstring& title,
- const GURL& url,
- Style style)
+ const GURL& url)
: delegate_(delegate),
parent_window_(parent_window),
title_(WideToUTF16Hack(title)),
url_(url),
- style_(style),
- bubble_frame_view_(NULL),
is_open_(false) {
gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size()));
width_ = static_cast<int>(kDefaultWidthRatio * screen_bounds.width());
@@ -55,32 +46,11 @@ LoginHtmlDialog::~LoginHtmlDialog() {
}
void LoginHtmlDialog::Show() {
+ Profile* profile = ProfileManager::GetDefaultProfile();
HtmlDialogView* html_view =
new HtmlDialogView(ProfileManager::GetDefaultProfile(), this);
-#if defined(USE_AURA)
- // TODO(saintlou): Until the new Bubble have been landed.
- views::Widget::CreateWindowWithParent(html_view, parent_window_);
- html_view->InitDialog();
-#else
- if (style_ & STYLE_BUBBLE) {
- views::Widget* bubble_window = BubbleWindow::Create(parent_window_,
- static_cast<DialogStyle>(STYLE_XBAR | STYLE_THROBBER),
- html_view);
- bubble_frame_view_ = static_cast<BubbleFrameView*>(
- bubble_window->non_client_view()->frame_view());
- } else {
- views::Widget::CreateWindowWithParent(html_view, parent_window_);
- }
- html_view->InitDialog();
- if (bubble_frame_view_) {
- bubble_frame_view_->StartThrobber();
- notification_registrar_.Add(
- this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
- content::Source<TabContents>(
- html_view->dom_contents()->tab_contents()));
- }
-#endif
- html_view->GetWidget()->Show();
+ // TODO(msw): Respect style? Support Throbber if actually used...
+ browser::ShowHtmlDialog(parent_window_, profile, html_view, STYLE_FLUSH);
is_open_ = true;
}
@@ -119,7 +89,6 @@ std::string LoginHtmlDialog::GetDialogArgs() const {
void LoginHtmlDialog::OnDialogClosed(const std::string& json_retval) {
is_open_ = false;
- notification_registrar_.RemoveAll();
if (delegate_)
delegate_->OnDialogClosed();
}
@@ -139,17 +108,4 @@ bool LoginHtmlDialog::HandleContextMenu(const ContextMenuParams& params) {
return true;
}
-void LoginHtmlDialog::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK(type == content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME);
-#if defined(USE_AURA)
- // TODO(saintlou): Do we need a throbber for Aura?
- NOTIMPLEMENTED();
-#else
- if (bubble_frame_view_)
- bubble_frame_view_->StopThrobber();
-#endif
-}
-
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/login_html_dialog.h ('k') | chrome/browser/chromeos/login/proxy_settings_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698