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_UI_EXTENSIONS_SHELL_WINDOW_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/extensions/extension_host.h" |
| 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" |
| 13 |
| 14 class GURL; |
| 15 class Extension; |
| 16 class ExtensionHost; |
| 17 class Profile; |
| 18 |
| 19 namespace content { |
| 20 class WebContents; |
| 21 } |
| 22 |
| 23 class ShellWindow : public content::NotificationObserver { |
| 24 public: |
| 25 content::WebContents* web_contents() const { return host_->host_contents(); } |
| 26 |
| 27 static ShellWindow* Create(Profile* profile, |
| 28 const Extension* extension, |
| 29 const GURL& url); |
| 30 |
| 31 // Closes the displayed window and invokes the destructor. |
| 32 virtual void Close() = 0; |
| 33 |
| 34 // content::NotificationObserver implementation. |
| 35 virtual void Observe(int type, |
| 36 const content::NotificationSource& source, |
| 37 const content::NotificationDetails& details) OVERRIDE; |
| 38 |
| 39 protected: |
| 40 explicit ShellWindow(ExtensionHost* host_); |
| 41 virtual ~ShellWindow(); |
| 42 |
| 43 // Instantiates a platform-specific ShellWindow subclass (one implementation |
| 44 // per platform). Public users of ShellWindow should use ShellWindow::Create. |
| 45 static ShellWindow* CreateShellWindow(ExtensionHost* host); |
| 46 |
| 47 scoped_ptr<ExtensionHost> host_; |
| 48 |
| 49 content::NotificationRegistrar registrar_; |
| 50 }; |
| 51 |
| 52 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
OLD | NEW |