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

Unified Diff: chrome/browser/ui/extensions/shell_window.h

Issue 10825240: Refactor ShellWindow to separate platform-specific code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 4 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
« no previous file with comments | « chrome/browser/ui/extensions/native_shell_window.h ('k') | chrome/browser/ui/extensions/shell_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/extensions/shell_window.h
diff --git a/chrome/browser/ui/extensions/shell_window.h b/chrome/browser/ui/extensions/shell_window.h
index 078347d0212c87d3698dee2b27723e988fde0b75..b7a137f9e4d677fe726ca915c273894958232760 100644
--- a/chrome/browser/ui/extensions/shell_window.h
+++ b/chrome/browser/ui/extensions/shell_window.h
@@ -19,6 +19,7 @@
class GURL;
class Profile;
class TabContents;
+class NativeShellWindow;
namespace content {
class WebContents;
@@ -37,8 +38,7 @@ struct DraggableRegion;
class ShellWindow : public content::NotificationObserver,
public content::WebContentsDelegate,
public content::WebContentsObserver,
- public ExtensionFunctionDispatcher::Delegate,
- public BaseWindow {
+ public ExtensionFunctionDispatcher::Delegate {
public:
struct CreateParams {
enum Frame {
@@ -65,40 +65,33 @@ class ShellWindow : public content::NotificationObserver,
const extensions::Extension* extension() const { return extension_; }
const TabContents* tab_contents() const { return contents_.get(); }
content::WebContents* web_contents() const { return web_contents_; }
+ Profile* profile() const { return profile_; }
- protected:
- ShellWindow(Profile* profile,
- const extensions::Extension* extension,
- const GURL& url);
- virtual ~ShellWindow();
+ BaseWindow* GetBaseWindow();
+ gfx::NativeWindow GetNativeWindow() {
+ return GetBaseWindow()->GetNativeWindow();
+ }
- // Called when the title of the window changes.
- virtual void UpdateWindowTitle() {}
- // Sub-classes should call this to determine what the window's title is on
- // startup and from within UpdateWindowTitle().
+ // NativeShellWindows should call this to determine what the window's title
+ // is on startup and from within UpdateWindowTitle().
virtual string16 GetTitle() const;
- virtual void SetFullscreen(bool fullscreen) {}
- virtual bool IsFullscreenOrPending() const;
-
- // Called when the draggable regions are changed.
- virtual void UpdateDraggableRegions(
- const std::vector<extensions::DraggableRegion>& regions) {}
-
// Call to notify ShellRegistry and delete the window. Subclasses should
// invoke this method instead of using "delete this".
void OnNativeClose();
+ protected:
+ ShellWindow(Profile* profile,
+ const extensions::Extension* extension);
+ virtual ~ShellWindow();
+
private:
// PlatformAppBrowserTest needs access to web_contents()
friend class extensions::PlatformAppBrowserTest;
// Instantiates a platform-specific ShellWindow subclass (one implementation
// per platform). Public users of ShellWindow should use ShellWindow::Create.
- static ShellWindow* CreateImpl(Profile* profile,
- const extensions::Extension* extension,
- const GURL& url,
- const CreateParams& params);
+ void Init(const GURL& url, const CreateParams& params);
// content::WebContentsObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
@@ -151,6 +144,9 @@ class ShellWindow : public content::NotificationObserver,
void AddMessageToDevToolsConsole(content::ConsoleMessageLevel level,
const std::string& message);
+ virtual void UpdateDraggableRegions(
+ const std::vector<extensions::DraggableRegion>& regions);
+
Profile* profile_; // weak pointer - owned by ProfileManager.
// weak pointer - owned by ExtensionService.
const extensions::Extension* extension_;
@@ -162,6 +158,8 @@ class ShellWindow : public content::NotificationObserver,
content::NotificationRegistrar registrar_;
ExtensionFunctionDispatcher extension_function_dispatcher_;
+ scoped_ptr<NativeShellWindow> native_window_;
+
DISALLOW_COPY_AND_ASSIGN(ShellWindow);
};
« no previous file with comments | « chrome/browser/ui/extensions/native_shell_window.h ('k') | chrome/browser/ui/extensions/shell_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698