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

Unified Diff: chrome/browser/chromeos/ui/screensaver_extension_dialog.h

Issue 9455038: Screensaver at login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review changes. Created 8 years, 10 months 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/ui/screensaver_extension_dialog.h
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 0000000000000000000000000000000000000000..d11dede10ab990240e0e2c6b0e2f972e8e9f8969
--- /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_

Powered by Google App Engine
This is Rietveld 408576698