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

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: missing file 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
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 1c684021b6b6b267b4bbb7f1979d56a1819c6796..da8f9a1082344654ed9700a7e6daaecc66bf74b8 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;
@@ -35,8 +36,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 {
@@ -63,40 +63,30 @@ 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();
+ virtual BaseWindow* GetBaseWindow();
Ben Goodger (Google) 2012/08/08 16:58:28 does this need to be virtual?
jeremya 2012/08/09 23:59:53 I guess not :)
- // 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 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;
@@ -149,6 +139,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_;
@@ -160,6 +153,8 @@ class ShellWindow : public content::NotificationObserver,
content::NotificationRegistrar registrar_;
ExtensionFunctionDispatcher extension_function_dispatcher_;
+ NativeShellWindow* native_window_;
+
DISALLOW_COPY_AND_ASSIGN(ShellWindow);
};

Powered by Google App Engine
This is Rietveld 408576698