Commit eb1d32ad authored by tfarina@chromium.org's avatar tfarina@chromium.org

chromeos: Rename LoginHtmlDialog to LoginWebDialog.

This is a follow up to r133991.

R=stevenjb@chromium.org,avayvod@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10254027

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134775 0039d316-1c4b-4281-b951-d872f2087c98
parent 932a4e28
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -55,13 +55,13 @@ void HelpAppLauncher::ShowHelpTopic(HelpTopic help_topic_id) { ...@@ -55,13 +55,13 @@ void HelpAppLauncher::ShowHelpTopic(HelpTopic help_topic_id) {
void HelpAppLauncher::ShowHelpTopicDialog(const GURL& topic_url) { void HelpAppLauncher::ShowHelpTopicDialog(const GURL& topic_url) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
dialog_.reset(new LoginHtmlDialog( dialog_.reset(new LoginWebDialog(
this, this,
parent_window_, parent_window_,
UTF16ToWide( UTF16ToWide(
l10n_util::GetStringUTF16(IDS_LOGIN_OOBE_HELP_DIALOG_TITLE)), l10n_util::GetStringUTF16(IDS_LOGIN_OOBE_HELP_DIALOG_TITLE)),
topic_url, topic_url,
LoginHtmlDialog::STYLE_BUBBLE)); LoginWebDialog::STYLE_BUBBLE));
dialog_->Show(); dialog_->Show();
} }
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/login/login_html_dialog.h" #include "chrome/browser/chromeos/login/login_web_dialog.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
namespace chromeos { namespace chromeos {
...@@ -17,7 +17,7 @@ namespace chromeos { ...@@ -17,7 +17,7 @@ namespace chromeos {
// Provides help content during OOBE / login. // Provides help content during OOBE / login.
// Based on connectivity state (offline/online) shows help topic dialog // Based on connectivity state (offline/online) shows help topic dialog
// or launches HelpApp in BWSI mode. // or launches HelpApp in BWSI mode.
class HelpAppLauncher : public LoginHtmlDialog::Delegate, class HelpAppLauncher : public LoginWebDialog::Delegate,
public base::RefCountedThreadSafe<HelpAppLauncher> { public base::RefCountedThreadSafe<HelpAppLauncher> {
public: public:
// IDs of help topics available from HelpApp. // IDs of help topics available from HelpApp.
...@@ -47,7 +47,7 @@ class HelpAppLauncher : public LoginHtmlDialog::Delegate, ...@@ -47,7 +47,7 @@ class HelpAppLauncher : public LoginHtmlDialog::Delegate,
bool is_open() const { return dialog_.get() && dialog_->is_open(); } bool is_open() const { return dialog_.get() && dialog_->is_open(); }
protected: protected:
// LoginHtmlDialog::Delegate implementation: // LoginWebDialog::Delegate implementation:
virtual void OnDialogClosed() OVERRIDE {} virtual void OnDialogClosed() OVERRIDE {}
private: private:
...@@ -55,7 +55,7 @@ class HelpAppLauncher : public LoginHtmlDialog::Delegate, ...@@ -55,7 +55,7 @@ class HelpAppLauncher : public LoginHtmlDialog::Delegate,
void ShowHelpTopicDialog(const GURL& topic_url); void ShowHelpTopicDialog(const GURL& topic_url);
// Dialog used to display help like "Can't access your account". // Dialog used to display help like "Can't access your account".
scoped_ptr<LoginHtmlDialog> dialog_; scoped_ptr<LoginWebDialog> dialog_;
// Parent window which is passed to help dialog. // Parent window which is passed to help dialog.
gfx::NativeWindow parent_window_; gfx::NativeWindow parent_window_;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/chromeos/login/login_html_dialog.h" #include "chrome/browser/chromeos/login/login_web_dialog.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/helper.h"
...@@ -29,16 +29,16 @@ const double kDefaultHeightRatio = 0.6; ...@@ -29,16 +29,16 @@ const double kDefaultHeightRatio = 0.6;
} // namespace } // namespace
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// LoginHtmlDialog, public: // LoginWebDialog, public:
void LoginHtmlDialog::Delegate::OnDialogClosed() { void LoginWebDialog::Delegate::OnDialogClosed() {
} }
LoginHtmlDialog::LoginHtmlDialog(Delegate* delegate, LoginWebDialog::LoginWebDialog(Delegate* delegate,
gfx::NativeWindow parent_window, gfx::NativeWindow parent_window,
const std::wstring& title, const std::wstring& title,
const GURL& url, const GURL& url,
Style style) Style style)
: delegate_(delegate), : delegate_(delegate),
parent_window_(parent_window), parent_window_(parent_window),
title_(WideToUTF16Hack(title)), title_(WideToUTF16Hack(title)),
...@@ -51,80 +51,80 @@ LoginHtmlDialog::LoginHtmlDialog(Delegate* delegate, ...@@ -51,80 +51,80 @@ LoginHtmlDialog::LoginHtmlDialog(Delegate* delegate,
height_ = static_cast<int>(kDefaultHeightRatio * screen_bounds.height()); height_ = static_cast<int>(kDefaultHeightRatio * screen_bounds.height());
} }
LoginHtmlDialog::~LoginHtmlDialog() { LoginWebDialog::~LoginWebDialog() {
delegate_ = NULL; delegate_ = NULL;
} }
void LoginHtmlDialog::Show() { void LoginWebDialog::Show() {
views::Widget::CreateWindowWithParent( views::Widget::CreateWindowWithParent(
new WebDialogView(ProfileManager::GetDefaultProfile(), NULL, this), new WebDialogView(ProfileManager::GetDefaultProfile(), NULL, this),
parent_window_)->Show(); parent_window_)->Show();
is_open_ = true; is_open_ = true;
} }
void LoginHtmlDialog::SetDialogSize(int width, int height) { void LoginWebDialog::SetDialogSize(int width, int height) {
DCHECK(width >= 0 && height >= 0); DCHECK(width >= 0 && height >= 0);
width_ = width; width_ = width;
height_ = height; height_ = height;
} }
void LoginHtmlDialog::SetDialogTitle(const string16& title) { void LoginWebDialog::SetDialogTitle(const string16& title) {
title_ = title; title_ = title;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// LoginHtmlDialog, protected: // LoginWebDialog, protected:
ui::ModalType LoginHtmlDialog::GetDialogModalType() const { ui::ModalType LoginWebDialog::GetDialogModalType() const {
return ui::MODAL_TYPE_SYSTEM; return ui::MODAL_TYPE_SYSTEM;
} }
string16 LoginHtmlDialog::GetDialogTitle() const { string16 LoginWebDialog::GetDialogTitle() const {
return title_; return title_;
} }
GURL LoginHtmlDialog::GetDialogContentURL() const { GURL LoginWebDialog::GetDialogContentURL() const {
return url_; return url_;
} }
void LoginHtmlDialog::GetWebUIMessageHandlers( void LoginWebDialog::GetWebUIMessageHandlers(
std::vector<WebUIMessageHandler*>* handlers) const { std::vector<WebUIMessageHandler*>* handlers) const {
} }
void LoginHtmlDialog::GetDialogSize(gfx::Size* size) const { void LoginWebDialog::GetDialogSize(gfx::Size* size) const {
size->SetSize(width_, height_); size->SetSize(width_, height_);
} }
std::string LoginHtmlDialog::GetDialogArgs() const { std::string LoginWebDialog::GetDialogArgs() const {
return std::string(); return std::string();
} }
void LoginHtmlDialog::OnDialogClosed(const std::string& json_retval) { void LoginWebDialog::OnDialogClosed(const std::string& json_retval) {
is_open_ = false; is_open_ = false;
notification_registrar_.RemoveAll(); notification_registrar_.RemoveAll();
if (delegate_) if (delegate_)
delegate_->OnDialogClosed(); delegate_->OnDialogClosed();
} }
void LoginHtmlDialog::OnCloseContents(WebContents* source, void LoginWebDialog::OnCloseContents(WebContents* source,
bool* out_close_dialog) { bool* out_close_dialog) {
if (out_close_dialog) if (out_close_dialog)
*out_close_dialog = true; *out_close_dialog = true;
} }
bool LoginHtmlDialog::ShouldShowDialogTitle() const { bool LoginWebDialog::ShouldShowDialogTitle() const {
return true; return true;
} }
bool LoginHtmlDialog::HandleContextMenu( bool LoginWebDialog::HandleContextMenu(
const content::ContextMenuParams& params) { const content::ContextMenuParams& params) {
// Disable context menu. // Disable context menu.
return true; return true;
} }
void LoginHtmlDialog::Observe(int type, void LoginWebDialog::Observe(int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) { const content::NotificationDetails& details) {
DCHECK(type == content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); DCHECK(type == content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME);
// TODO(saintlou): Do we need a throbber for Aura? // TODO(saintlou): Do we need a throbber for Aura?
NOTIMPLEMENTED(); NOTIMPLEMENTED();
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_HTML_DIALOG_H_ #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_WEB_DIALOG_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_HTML_DIALOG_H_ #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_WEB_DIALOG_H_
#pragma once #pragma once
#include <string> #include <string>
...@@ -20,16 +20,17 @@ namespace chromeos { ...@@ -20,16 +20,17 @@ namespace chromeos {
class BubbleFrameView; class BubbleFrameView;
// Launches web dialog during OOBE/Login with specified URL and title. // Launches web dialog during OOBE/Login with specified URL and title.
class LoginHtmlDialog : public WebDialogDelegate, class LoginWebDialog : public WebDialogDelegate,
public content::NotificationObserver { public content::NotificationObserver {
public: public:
// Delegate class to get notifications from the dialog. // Delegate class to get notifications from the dialog.
class Delegate { class Delegate {
public: public:
virtual ~Delegate() {}
// Called when dialog has been closed. // Called when dialog has been closed.
virtual void OnDialogClosed(); virtual void OnDialogClosed();
protected:
virtual ~Delegate() {}
}; };
enum Style { enum Style {
...@@ -37,14 +38,13 @@ class LoginHtmlDialog : public WebDialogDelegate, ...@@ -37,14 +38,13 @@ class LoginHtmlDialog : public WebDialogDelegate,
STYLE_BUBBLE // Use chromeos::BubbleWindow as a host. STYLE_BUBBLE // Use chromeos::BubbleWindow as a host.
}; };
LoginHtmlDialog(Delegate* delegate, LoginWebDialog(Delegate* delegate,
gfx::NativeWindow parent_window, gfx::NativeWindow parent_window,
const std::wstring& title, const std::wstring& title,
const GURL& url, const GURL& url,
Style style); Style style);
virtual ~LoginHtmlDialog(); virtual ~LoginWebDialog();
// Shows created dialog.
void Show(); void Show();
// Overrides default width/height for dialog. // Overrides default width/height for dialog.
...@@ -94,9 +94,9 @@ class LoginHtmlDialog : public WebDialogDelegate, ...@@ -94,9 +94,9 @@ class LoginHtmlDialog : public WebDialogDelegate,
int width_; int width_;
int height_; int height_;
DISALLOW_COPY_AND_ASSIGN(LoginHtmlDialog); DISALLOW_COPY_AND_ASSIGN(LoginWebDialog);
}; };
} // namespace chromeos } // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_HTML_DIALOG_H_ #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_WEB_DIALOG_H_
...@@ -39,14 +39,14 @@ namespace chromeos { ...@@ -39,14 +39,14 @@ namespace chromeos {
// static // static
int ProxySettingsDialog::instance_count_ = 0; int ProxySettingsDialog::instance_count_ = 0;
ProxySettingsDialog::ProxySettingsDialog(LoginHtmlDialog::Delegate* delegate, ProxySettingsDialog::ProxySettingsDialog(LoginWebDialog::Delegate* delegate,
gfx::NativeWindow window) gfx::NativeWindow window)
: LoginHtmlDialog( : LoginWebDialog(
delegate, delegate,
window, window,
std::wstring(), std::wstring(),
GURL(chrome::kChromeUIProxySettingsURL), GURL(chrome::kChromeUIProxySettingsURL),
LoginHtmlDialog::STYLE_BUBBLE) { LoginWebDialog::STYLE_BUBBLE) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
++instance_count_; ++instance_count_;
...@@ -74,7 +74,7 @@ ProxySettingsDialog::~ProxySettingsDialog() { ...@@ -74,7 +74,7 @@ ProxySettingsDialog::~ProxySettingsDialog() {
} }
void ProxySettingsDialog::OnDialogClosed(const std::string& json_retval) { void ProxySettingsDialog::OnDialogClosed(const std::string& json_retval) {
LoginHtmlDialog::OnDialogClosed(json_retval); LoginWebDialog::OnDialogClosed(json_retval);
content::NotificationService::current()->Notify( content::NotificationService::current()->Notify(
chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, chrome::NOTIFICATION_LOGIN_PROXY_CHANGED,
content::NotificationService::AllSources(), content::NotificationService::AllSources(),
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
#define CHROME_BROWSER_CHROMEOS_LOGIN_PROXY_SETTINGS_DIALOG_H_ #define CHROME_BROWSER_CHROMEOS_LOGIN_PROXY_SETTINGS_DIALOG_H_
#pragma once #pragma once
#include "chrome/browser/chromeos/login/login_html_dialog.h" #include "chrome/browser/chromeos/login/login_web_dialog.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
namespace chromeos { namespace chromeos {
// Should be used on the UI thread only, because of static |instance_count_|. // Should be used on the UI thread only, because of static |instance_count_|.
class ProxySettingsDialog : public LoginHtmlDialog { class ProxySettingsDialog : public LoginWebDialog {
public: public:
// Returns whether the dialog is being shown. // Returns whether the dialog is being shown.
static bool IsShown(); static bool IsShown();
ProxySettingsDialog(LoginHtmlDialog::Delegate* delegate, ProxySettingsDialog(LoginWebDialog::Delegate* delegate,
gfx::NativeWindow window); gfx::NativeWindow window);
virtual ~ProxySettingsDialog(); virtual ~ProxySettingsDialog();
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <map> #include <map>
#include <string> #include <string>
#include "chrome/browser/chromeos/login/login_html_dialog.h"
#include "chrome/browser/tab_render_watcher.h" #include "chrome/browser/tab_render_watcher.h"
#include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h"
#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_observer.h"
......
...@@ -660,8 +660,8 @@ ...@@ -660,8 +660,8 @@
'browser/chromeos/login/login_display.cc', 'browser/chromeos/login/login_display.cc',
'browser/chromeos/login/login_display.h', 'browser/chromeos/login/login_display.h',
'browser/chromeos/login/login_display_host.h', 'browser/chromeos/login/login_display_host.h',
'browser/chromeos/login/login_html_dialog.cc', 'browser/chromeos/login/login_web_dialog.cc',
'browser/chromeos/login/login_html_dialog.h', 'browser/chromeos/login/login_web_dialog.h',
'browser/chromeos/login/login_performer.cc', 'browser/chromeos/login/login_performer.cc',
'browser/chromeos/login/login_performer.h', 'browser/chromeos/login/login_performer.h',
'browser/chromeos/login/login_status_consumer.cc', 'browser/chromeos/login/login_status_consumer.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment