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

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

Issue 23835007: DevTools: Do not close devtools if there are dirty files in workspace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reupload Created 7 years, 3 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/devtools/devtools_window.h
diff --git a/chrome/browser/devtools/devtools_window.h b/chrome/browser/devtools/devtools_window.h
index e3b2e90525e6e6effd06f68c155c630c8d8cfe73..e3cfd7df898953198c55ee615122e57e395b4a37 100644
--- a/chrome/browser/devtools/devtools_window.h
+++ b/chrome/browser/devtools/devtools_window.h
@@ -54,6 +54,12 @@ enum DevToolsDockSide {
DEVTOOLS_DOCK_SIDE_MINIMIZED
};
+enum DevToolsClosingTarget {
+ DEVTOOLS_CLOSING_TARGET_NONE = 0,
+ DEVTOOLS_CLOSING_TARGET_DEVTOOLS,
+ DEVTOOLS_CLOSING_TARGET_INSPECTED_PAGE
+};
+
class DevToolsWindow : private content::NotificationObserver,
private content::WebContentsDelegate,
private content::DevToolsFrontendHostDelegate,
@@ -67,6 +73,8 @@ class DevToolsWindow : private content::NotificationObserver,
static std::string GetDevToolsWindowPlacementPrefKey();
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+ static DevToolsWindow* GetInstanceForInspectedTab(
+ content::WebContents* inspected_tab);
static DevToolsWindow* GetDockedInstanceForInspectedTab(
content::WebContents* inspected_tab);
static bool IsDevToolsWindow(content::RenderViewHost* window_rvh);
@@ -125,6 +133,10 @@ class DevToolsWindow : private content::NotificationObserver,
void Show(DevToolsToggleAction action);
+ static void HandleBeforeUnload(content::WebContents*, bool, bool*);
+ bool InspectedPageWillClose();
+ void InspectedPageCancelClose();
+
private:
friend class DevToolsControllerTest;
@@ -166,6 +178,9 @@ class DevToolsWindow : private content::NotificationObserver,
bool user_gesture,
bool* was_blocked) OVERRIDE;
virtual void CloseContents(content::WebContents* source) OVERRIDE;
+ virtual void BeforeUnloadFired(content::WebContents* tab,
+ bool proceed,
+ bool* proceed_to_fire_unload) OVERRIDE;
virtual bool PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event,
@@ -188,6 +203,7 @@ class DevToolsWindow : private content::NotificationObserver,
// DevToolsEmbedderMessageDispatcher::Delegate overrides:
virtual void ActivateWindow() OVERRIDE;
+ virtual void ActivateContents(content::WebContents* contents) OVERRIDE;
virtual void CloseWindow() OVERRIDE;
virtual void MoveWindow(int x, int y) OVERRIDE;
virtual void SetDockSide(const std::string& side) OVERRIDE;
@@ -269,6 +285,8 @@ class DevToolsWindow : private content::NotificationObserver,
int width_;
int height_;
DevToolsDockSide dock_side_before_minimized_;
+ DevToolsClosingTarget closing_target_;
+ bool inspected_page_is_closing_;
scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_;
DISALLOW_COPY_AND_ASSIGN(DevToolsWindow);
« no previous file with comments | « no previous file | chrome/browser/devtools/devtools_window.cc » ('j') | chrome/browser/devtools/devtools_window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698