diff options
author | rkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-28 05:36:10 +0000 |
---|---|---|
committer | rkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-28 05:36:10 +0000 |
commit | e165130f2b6c70c9b0bf70d2e787ba9fb86e7655 (patch) | |
tree | 90ba0adbea96954b8b631781b9f1207a1e6cfc74 /chrome/browser/chromeos/ui/screensaver_extension_dialog.h | |
parent | 508e5cd1ca85d1ab70e3456816120f8533dbafe1 (diff) | |
download | chromium_src-e165130f2b6c70c9b0bf70d2e787ba9fb86e7655.zip chromium_src-e165130f2b6c70c9b0bf70d2e787ba9fb86e7655.tar.gz chromium_src-e165130f2b6c70c9b0bf70d2e787ba9fb86e7655.tar.bz2 |
Screensaver at login screen.
This CL adds code to show a screensaver on the login screen. The location of the screensaver and timeout for it to show up are currently hard coded but will be changed to pull from an enterprise policy once work on that end is completed.
The screensaver stays active only on the login screen, if any user logs on, we de-activate the screensaver for the rest of the session. Since logout causes a Chrome restart, we will be active on the login screen again.
If the screensaver crashes, we reload the extension and show ourselves again.
R=sky@chromium.org,xiyuan@chromium.org,yoz@chromium.org
BUG=chromium-os:26042
TEST=Tested that the screensaver comes up on the login screen, does not come up once we log in, reloads when I manually crash the screensaver extension process. Also verified that SelectFileDialog on ChromeOS works as intended.
Review URL: http://codereview.chromium.org/9455038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/ui/screensaver_extension_dialog.h')
-rw-r--r-- | chrome/browser/chromeos/ui/screensaver_extension_dialog.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/ui/screensaver_extension_dialog.h b/chrome/browser/chromeos/ui/screensaver_extension_dialog.h new file mode 100644 index 0000000..d11dede --- /dev/null +++ b/chrome/browser/chromeos/ui/screensaver_extension_dialog.h @@ -0,0 +1,65 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_UI_SCREENSAVER_EXTENSION_DIALOG_H_ +#define CHROME_BROWSER_CHROMEOS_UI_SCREENSAVER_EXTENSION_DIALOG_H_ +#pragma once + +#include "base/memory/ref_counted.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/views/extensions/extension_dialog_observer.h" + +class Extension; +class ExtensionDialog; + +namespace browser { + +void ShowScreensaverDialog(); +void CloseScreensaverDialog(); + +} // namespace browser + +// Shows or hides the screensaver extension in fullscreen mode on +// top of all other windows. +class ScreensaverExtensionDialog + : public ExtensionDialogObserver { + public: + static void ShowScreensaverDialog(); + static void CloseScreensaverDialog(); + + // ExtensionDialog::Observer implementation. + virtual void ExtensionDialogClosing(ExtensionDialog* dialog) OVERRIDE; + virtual void ExtensionTerminated(ExtensionDialog* dialog) OVERRIDE; + + protected: + // ScreensaverDialog implementation. + virtual void Show() OVERRIDE; + virtual void Close() OVERRIDE; + + private: + friend class ScreensaverExtensionDialogBrowserTest; + friend class ScreensaverExtensionDialogTest; + + ScreensaverExtensionDialog(); + virtual ~ScreensaverExtensionDialog(); + + // Load the screensaver extension. + void LoadExtension(); + // Callback to set the extension and show the dialog. + // Called from LoadExtension. + void SetExtensionAndShow(scoped_refptr<Extension> extension); + // Reload the screensaver extension and show another screensaver dialog. + void ReloadAndShow(); + + scoped_refptr<Extension> screensaver_extension_; + // Host for the extension that implements this dialog. + scoped_refptr<ExtensionDialog> extension_dialog_; + + // Set while we're loading an extension; only touched from the UI thread. + bool loading_extension_; + + DISALLOW_COPY_AND_ASSIGN(ScreensaverExtensionDialog); +}; + +#endif // CHROME_BROWSER_CHROMEOS_UI_SCREENSAVER_EXTENSION_DIALOG_H_ |