OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_UI_SCREENSAVER_EXTENSION_DIALOG_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_UI_SCREENSAVER_EXTENSION_DIALOG_H_ | |
7 #pragma once | |
8 | |
9 #include "base/memory/ref_counted.h" | |
10 #include "chrome/browser/profiles/profile.h" | |
11 #include "chrome/browser/ui/views/extensions/extension_dialog_observer.h" | |
12 | |
13 class Extension; | |
14 class ExtensionDialog; | |
15 | |
16 namespace browser { | |
17 | |
18 void ShowScreensaverDialog(scoped_refptr<Extension> extension); | |
19 void CloseScreensaverDialog(); | |
20 | |
21 } // namespace browser | |
22 | |
23 // Shows or hides the screensaver extension in fullscreen mode on | |
24 // top of all other windows. | |
25 class ScreensaverExtensionDialog : public ExtensionDialogObserver { | |
26 public: | |
27 static void ShowScreensaverDialog(scoped_refptr<Extension> extension); | |
28 static void CloseScreensaverDialog(); | |
29 | |
30 // ExtensionDialog::Observer implementation. | |
31 virtual void ExtensionDialogClosing(ExtensionDialog* dialog) OVERRIDE; | |
32 virtual void ExtensionTerminated(ExtensionDialog* dialog) OVERRIDE; | |
33 | |
34 protected: | |
35 virtual void Show(); | |
36 virtual void Close(); | |
37 | |
38 private: | |
39 friend class ScreensaverExtensionDialogBrowserTest; | |
40 friend class ScreensaverExtensionDialogTest; | |
41 | |
42 explicit ScreensaverExtensionDialog(scoped_refptr<Extension> extension); | |
43 virtual ~ScreensaverExtensionDialog(); | |
44 | |
45 // Reload the screensaver extension and show another screensaver dialog. | |
46 void ReloadAndShow(); | |
47 | |
48 scoped_refptr<Extension> screensaver_extension_; | |
49 // Host for the extension that implements this dialog. | |
50 scoped_refptr<ExtensionDialog> extension_dialog_; | |
51 | |
52 // Set while we're loading an extension; only touched from the UI thread. | |
53 bool loading_extension_; | |
54 | |
55 DISALLOW_COPY_AND_ASSIGN(ScreensaverExtensionDialog); | |
56 }; | |
57 | |
58 #endif // CHROME_BROWSER_CHROMEOS_UI_SCREENSAVER_EXTENSION_DIALOG_H_ | |
OLD | NEW |