summaryrefslogtreecommitdiffstats
path: root/chrome/browser/debugger
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 16:22:34 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 16:22:34 +0000
commit5fa736e6cc3c636a676f1b40a2606db7523a6476 (patch)
treef0d19a331d292365b00a5b00d9630706ee67d1e7 /chrome/browser/debugger
parentded49f8fc73b04689433c062da4a09a9fbe0ff7c (diff)
downloadchromium_src-5fa736e6cc3c636a676f1b40a2606db7523a6476.zip
chromium_src-5fa736e6cc3c636a676f1b40a2606db7523a6476.tar.gz
chromium_src-5fa736e6cc3c636a676f1b40a2606db7523a6476.tar.bz2
DevTools crash: DevToolsWindow::SetDocked(bool)
BUG=32035 Review URL: http://codereview.chromium.org/541046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36122 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/debugger')
-rw-r--r--chrome/browser/debugger/devtools_window.cc38
-rw-r--r--chrome/browser/debugger/devtools_window.h1
2 files changed, 25 insertions, 14 deletions
diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc
index 5066bfa..3de0d5a 100644
--- a/chrome/browser/debugger/devtools_window.cc
+++ b/chrome/browser/debugger/devtools_window.cc
@@ -53,7 +53,6 @@ DevToolsWindow::DevToolsWindow(Profile* profile,
bool docked)
: profile_(profile),
browser_(NULL),
- inspected_window_(NULL),
docked_(docked),
is_loaded_(false),
open_console_on_load_(false) {
@@ -96,7 +95,10 @@ void DevToolsWindow::SendMessageToClient(const IPC::Message& message) {
void DevToolsWindow::InspectedTabClosing() {
if (docked_) {
// Update dev tools to reflect removed dev tools window.
- inspected_window_->UpdateDevTools();
+
+ BrowserWindow* inspected_window = GetInspectedBrowserWindow();
+ if (inspected_window)
+ inspected_window->UpdateDevTools();
// In case of docked tab_contents we own it, so delete here.
delete tab_contents_;
@@ -114,10 +116,10 @@ void DevToolsWindow::InspectedTabClosing() {
void DevToolsWindow::Show(bool open_console) {
if (docked_) {
// Just tell inspected browser to update splitter.
- inspected_window_ = GetInspectedBrowserWindow();
- if (inspected_window_) {
+ BrowserWindow* inspected_window = GetInspectedBrowserWindow();
+ if (inspected_window) {
tab_contents_->set_delegate(this);
- inspected_window_->UpdateDevTools();
+ inspected_window->UpdateDevTools();
tab_contents_->view()->SetInitialFocus();
return;
} else {
@@ -146,7 +148,9 @@ void DevToolsWindow::Activate() {
browser_->window()->Activate();
}
} else {
- inspected_window_->FocusDevTools();
+ BrowserWindow* inspected_window = GetInspectedBrowserWindow();
+ if (inspected_window)
+ inspected_window->FocusDevTools();
}
}
@@ -165,8 +169,11 @@ void DevToolsWindow::SetDocked(bool docked) {
browser_ = NULL;
} else {
// Update inspected window to hide split and reset it.
- inspected_window_->UpdateDevTools();
- inspected_window_ = NULL;
+ BrowserWindow* inspected_window = GetInspectedBrowserWindow();
+ if (inspected_window) {
+ inspected_window->UpdateDevTools();
+ inspected_window = NULL;
+ }
}
Show(false);
}
@@ -250,14 +257,19 @@ void DevToolsWindow::OpenConsole() {
bool DevToolsWindow::PreHandleKeyboardEvent(
const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) {
- if (docked_ && inspected_window_) {
- return inspected_window_->PreHandleKeyboardEvent(
- event, is_keyboard_shortcut);
+ if (docked_) {
+ BrowserWindow* inspected_window = GetInspectedBrowserWindow();
+ if (inspected_window)
+ return inspected_window->PreHandleKeyboardEvent(
+ event, is_keyboard_shortcut);
}
return false;
}
void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
- if (docked_ && inspected_window_)
- inspected_window_->HandleKeyboardEvent(event);
+ if (docked_) {
+ BrowserWindow* inspected_window = GetInspectedBrowserWindow();
+ if (inspected_window)
+ inspected_window->HandleKeyboardEvent(event);
+ }
}
diff --git a/chrome/browser/debugger/devtools_window.h b/chrome/browser/debugger/devtools_window.h
index 7db20a9..caa4418 100644
--- a/chrome/browser/debugger/devtools_window.h
+++ b/chrome/browser/debugger/devtools_window.h
@@ -90,7 +90,6 @@ class DevToolsWindow
TabContents* inspected_tab_;
TabContents* tab_contents_;
Browser* browser_;
- BrowserWindow* inspected_window_;
bool docked_;
bool is_loaded_;
bool open_console_on_load_;