summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authoryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 09:50:42 +0000
committeryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 09:50:42 +0000
commitf43ce8851e105df2d244e0dd516965917c65a23c (patch)
tree6cae81dddee0fe836b4da8412b006979c1f05107 /chrome/browser
parent59548b46618373a688f300fe282d0fe24d350aa8 (diff)
downloadchromium_src-f43ce8851e105df2d244e0dd516965917c65a23c.zip
chromium_src-f43ce8851e105df2d244e0dd516965917c65a23c.tar.gz
chromium_src-f43ce8851e105df2d244e0dd516965917c65a23c.tar.bz2
Add IsScreenLockerMode() interface to the StatusAreaHost class.
LanguageMenuButton will use the interface to implement crosbug.com/2619 (Implement input language selector on the log in page) BUG=none TEST=ran try bot Review URL: http://codereview.chromium.org/2846031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50709 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/frame/browser_view.cc4
-rw-r--r--chrome/browser/chromeos/frame/browser_view.h1
-rw-r--r--chrome/browser/chromeos/login/background_view.cc16
-rw-r--r--chrome/browser/chromeos/login/background_view.h8
-rw-r--r--chrome/browser/chromeos/login/screen_locker.cc2
-rw-r--r--chrome/browser/chromeos/status/status_area_host.h3
6 files changed, 26 insertions, 8 deletions
diff --git a/chrome/browser/chromeos/frame/browser_view.cc b/chrome/browser/chromeos/frame/browser_view.cc
index 124ecca..bdc2831 100644
--- a/chrome/browser/chromeos/frame/browser_view.cc
+++ b/chrome/browser/chromeos/frame/browser_view.cc
@@ -589,6 +589,10 @@ bool BrowserView::IsBrowserMode() const {
return true;
}
+bool BrowserView::IsScreenLockerMode() const {
+ return false;
+}
+
////////////////////////////////////////////////////////////////////////////////
// BrowserView public:
diff --git a/chrome/browser/chromeos/frame/browser_view.h b/chrome/browser/chromeos/frame/browser_view.h
index 8a53c97..9157607 100644
--- a/chrome/browser/chromeos/frame/browser_view.h
+++ b/chrome/browser/chromeos/frame/browser_view.h
@@ -83,6 +83,7 @@ class BrowserView : public ::BrowserView,
virtual void OpenButtonOptions(const views::View* button_view) const;
virtual bool IsButtonVisible(const views::View* button_view) const;
virtual bool IsBrowserMode() const;
+ virtual bool IsScreenLockerMode() const;
// Shows the compact location bar under the selected tab.
void ShowCompactLocationBarUnderSelectedTab(bool select_all);
diff --git a/chrome/browser/chromeos/login/background_view.cc b/chrome/browser/chromeos/login/background_view.cc
index 6f7baa6..eb85f61 100644
--- a/chrome/browser/chromeos/login/background_view.cc
+++ b/chrome/browser/chromeos/login/background_view.cc
@@ -31,10 +31,12 @@ using views::WidgetGtk;
namespace chromeos {
-BackgroundView::BackgroundView() : status_area_(NULL),
- os_version_label_(NULL),
- boot_times_label_(NULL),
- did_paint_(false) {
+BackgroundView::BackgroundView(bool for_screen_locker)
+ : status_area_(NULL),
+ os_version_label_(NULL),
+ boot_times_label_(NULL),
+ did_paint_(false),
+ for_screen_locker_(for_screen_locker) {
views::Painter* painter = CreateBackgroundPainter();
set_background(views::Background::CreateBackgroundPainter(true, painter));
InitStatusArea();
@@ -60,7 +62,7 @@ views::Widget* BackgroundView::CreateWindowContainingView(
WidgetGtk* window = new WidgetGtk(WidgetGtk::TYPE_WINDOW);
window->Init(NULL, bounds);
- *view = new BackgroundView();
+ *view = new BackgroundView(false /* for_screen_locker */);
window->SetContentsView(*view);
(*view)->UpdateWindowType();
@@ -146,6 +148,10 @@ bool BackgroundView::IsBrowserMode() const {
return false;
}
+bool BackgroundView::IsScreenLockerMode() const {
+ return for_screen_locker_;
+}
+
void BackgroundView::LocaleChanged() {
Layout();
SchedulePaint();
diff --git a/chrome/browser/chromeos/login/background_view.h b/chrome/browser/chromeos/login/background_view.h
index b7d9477..fafbe05 100644
--- a/chrome/browser/chromeos/login/background_view.h
+++ b/chrome/browser/chromeos/login/background_view.h
@@ -26,7 +26,7 @@ class StatusAreaView;
// StatusAreaView.
class BackgroundView : public views::View, public StatusAreaHost {
public:
- BackgroundView();
+ explicit BackgroundView(bool for_screen_locker);
// Creates a window containing an instance of WizardContentsView as the root
// view. The caller is responsible for showing (and closing) the returned
@@ -53,8 +53,9 @@ class BackgroundView : public views::View, public StatusAreaHost {
virtual void OpenButtonOptions(const views::View* button_view) const;
virtual bool IsButtonVisible(const views::View* button_view) const;
virtual bool IsBrowserMode() const;
+ virtual bool IsScreenLockerMode() const;
- private:
+private:
// Creates and adds the status_area.
void InitStatusArea();
// Creates and adds the labels for version and boot time.
@@ -89,6 +90,9 @@ class BackgroundView : public views::View, public StatusAreaHost {
// TODO(sky): nuke this when the wm knows when chrome has painted.
bool did_paint_;
+ // true if the background view is for the screen locker.
+ const bool for_screen_locker_;
+
DISALLOW_COPY_AND_ASSIGN(BackgroundView);
};
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index e97758f..284a2bc 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -395,7 +395,7 @@ ScreenLocker::ScreenLocker(const UserManager::User& user)
void ScreenLocker::Init(const gfx::Rect& bounds) {
// TODO(oshima): Figure out which UI to keep and remove in the background.
- views::View* screen = new BackgroundView();
+ views::View* screen = new BackgroundView(true /* for_screen_locker */);
LockWindow* lock_window = new LockWindow();
lock_window_ = lock_window;
lock_window_->Init(NULL, bounds);
diff --git a/chrome/browser/chromeos/status/status_area_host.h b/chrome/browser/chromeos/status/status_area_host.h
index 434da9b..d0e4e08 100644
--- a/chrome/browser/chromeos/status/status_area_host.h
+++ b/chrome/browser/chromeos/status/status_area_host.h
@@ -43,6 +43,9 @@ class StatusAreaHost {
// True if status area hosted in browser. Otherwise it's OOBE/login state.
virtual bool IsBrowserMode() const = 0;
+ // True if status area hosted in screen locker.
+ virtual bool IsScreenLockerMode() const = 0;
+
protected:
virtual ~StatusAreaHost() {}
};