| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/sessions/session_id.h" | 10 #include "chrome/browser/sessions/session_id.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 class WebContents; | 23 class WebContents; |
| 24 } | 24 } |
| 25 | 25 |
| 26 class ShellWindow : public content::NotificationObserver, | 26 class ShellWindow : public content::NotificationObserver, |
| 27 public BaseWindow { | 27 public BaseWindow { |
| 28 public: | 28 public: |
| 29 content::WebContents* web_contents() const { return host_->host_contents(); } | 29 content::WebContents* web_contents() const { return host_->host_contents(); } |
| 30 const SessionID& session_id() const { return session_id_; } | 30 const SessionID& session_id() const { return session_id_; } |
| 31 const ExtensionWindowController* extension_window_controller() const { |
| 32 return extension_window_controller_.get(); |
| 33 } |
| 31 | 34 |
| 32 static ShellWindow* Create(Profile* profile, | 35 static ShellWindow* Create(Profile* profile, |
| 33 const Extension* extension, | 36 const Extension* extension, |
| 34 const GURL& url); | 37 const GURL& url); |
| 35 | 38 |
| 36 // content::NotificationObserver implementation. | 39 // content::NotificationObserver implementation. |
| 37 virtual void Observe(int type, | 40 virtual void Observe(int type, |
| 38 const content::NotificationSource& source, | 41 const content::NotificationSource& source, |
| 39 const content::NotificationDetails& details) OVERRIDE; | 42 const content::NotificationDetails& details) OVERRIDE; |
| 40 | 43 |
| 41 protected: | 44 protected: |
| 42 explicit ShellWindow(ExtensionHost* host_); | 45 explicit ShellWindow(ExtensionHost* host_); |
| 43 virtual ~ShellWindow(); | 46 virtual ~ShellWindow(); |
| 44 | 47 |
| 45 // Instantiates a platform-specific ShellWindow subclass (one implementation | 48 // Instantiates a platform-specific ShellWindow subclass (one implementation |
| 46 // per platform). Public users of ShellWindow should use ShellWindow::Create. | 49 // per platform). Public users of ShellWindow should use ShellWindow::Create. |
| 47 static ShellWindow* CreateShellWindow(ExtensionHost* host); | 50 static ShellWindow* CreateShellWindow(ExtensionHost* host); |
| 48 | 51 |
| 49 const SessionID session_id_; | 52 const SessionID session_id_; |
| 50 scoped_ptr<ExtensionHost> host_; | 53 scoped_ptr<ExtensionHost> host_; |
| 51 content::NotificationRegistrar registrar_; | 54 content::NotificationRegistrar registrar_; |
| 52 scoped_ptr<ExtensionWindowController> extension_window_controller_; | 55 scoped_ptr<ExtensionWindowController> extension_window_controller_; |
| 53 | 56 |
| 54 private: | 57 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 58 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 61 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
| OLD | NEW |