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

Unified Diff: chrome/browser/debugger/devtools_window.h

Issue 149199: DevTools: Preserve devtools window contents on dock/undock. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/debugger/devtools_manager.cc ('k') | chrome/browser/debugger/devtools_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/debugger/devtools_window.h
===================================================================
--- chrome/browser/debugger/devtools_window.h (revision 19938)
+++ chrome/browser/debugger/devtools_window.h (working copy)
@@ -8,7 +8,9 @@
#include <string>
#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
#include "chrome/browser/debugger/devtools_client_host.h"
+#include "chrome/browser/tab_contents/tab_contents_delegate.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/notification_service.h"
@@ -22,45 +24,68 @@
class RenderViewHost;
class TabContents;
-class DevToolsWindow : public DevToolsClientHost, public NotificationObserver {
+class DevToolsWindow :
+ public DevToolsClientHost,
+ public NotificationObserver,
+ TabContentsDelegate {
public:
- static DevToolsWindow* CreateDevToolsWindow(Profile* profile,
- RenderViewHost* inspected_rvh,
- bool docked);
-
static TabContents* GetDevToolsContents(TabContents* inspected_tab);
+ DevToolsWindow(Profile* profile, RenderViewHost* inspected_rvh, bool docked);
virtual ~DevToolsWindow();
- virtual void Show() = 0;
- virtual void Activate() = 0;
- bool is_docked() { return docked_; };
- RenderViewHost* GetRenderViewHost();
- // DevToolsClientHost override.
+ // Overridden from DevToolsClientHost.
virtual DevToolsWindow* AsDevToolsWindow();
virtual void SendMessageToClient(const IPC::Message& message);
+ virtual void InspectedTabClosing();
- // NotificationObserver override.
+ void Show();
+ void Activate();
+ void SetDocked(bool docked);
+ RenderViewHost* GetRenderViewHost();
+
+ TabContents* tab_contents() { return tab_contents_; }
+ Browser* browser() { return browser_; } // For tests.
+ bool is_docked() { return docked_; };
+
+ private:
+ void CreateDevToolsBrowser();
+ BrowserWindow* GetInspectedBrowserWindow();
+
+ // Overridden from NotificationObserver.
virtual void Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details);
- TabContents* tab_contents() { return tab_contents_; }
- Browser* browser() { return browser_; }
+ // Overridden from TabContentsDelegate.
+ virtual void OpenURLFromTab(TabContents* source,
+ const GURL& url,
+ const GURL& referrer,
+ WindowOpenDisposition disposition,
+ PageTransition::Type transition) {}
+ virtual void NavigationStateChanged(const TabContents* source,
+ unsigned changed_flags) {}
+ virtual void AddNewContents(TabContents* source,
+ TabContents* new_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture) {}
+ virtual void ActivateContents(TabContents* contents) {}
+ virtual void LoadingStateChanged(TabContents* source) {}
+ virtual void CloseContents(TabContents* source) {}
+ virtual void MoveContents(TabContents* source, const gfx::Rect& pos) {}
+ virtual bool IsPopup(TabContents* source) { return false; }
+ virtual void URLStarredChanged(TabContents* source, bool starred) {}
+ virtual void UpdateTargetURL(TabContents* source, const GURL& url) {}
+ virtual void ToolbarSizeChanged(TabContents* source, bool is_animating) {}
- protected:
- DevToolsWindow(bool docked);
- GURL GetContentsUrl();
- void InitTabContents(TabContents* tab_contents);
-
+ Profile* profile_;
+ TabContents* inspected_tab_;
TabContents* tab_contents_;
Browser* browser_;
-
- private:
- static BrowserWindow* GetBrowserWindow(RenderViewHost* rvh);
+ BrowserWindow* inspected_window_;
+ bool docked_;
NotificationRegistrar registrar_;
-
- bool docked_;
DISALLOW_COPY_AND_ASSIGN(DevToolsWindow);
};
« no previous file with comments | « chrome/browser/debugger/devtools_manager.cc ('k') | chrome/browser/debugger/devtools_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698