diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 09:29:58 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 09:29:58 +0000 |
commit | 07a5cf9731ef2e28b73314326969790e53f7839b (patch) | |
tree | be0a8843b1e1bcedfe1253c9fb7bf21c2a1cf663 /chrome/browser | |
parent | f8e198b1b90e8100ad3861df7874b9c8fe722384 (diff) | |
download | chromium_src-07a5cf9731ef2e28b73314326969790e53f7839b.zip chromium_src-07a5cf9731ef2e28b73314326969790e53f7839b.tar.gz chromium_src-07a5cf9731ef2e28b73314326969790e53f7839b.tar.bz2 |
DevTools: Focus docked DevTools window on breakpoint.
Review URL: http://codereview.chromium.org/155423
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_window.h | 3 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_cocoa.h | 1 | ||||
-rw-r--r-- | chrome/browser/cocoa/browser_window_cocoa.mm | 4 | ||||
-rw-r--r-- | chrome/browser/debugger/devtools_window.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 1 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 5 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 1 |
8 files changed, 25 insertions, 2 deletions
diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h index dbffe09..d59daac 100644 --- a/chrome/browser/browser_window.h +++ b/chrome/browser/browser_window.h @@ -81,6 +81,9 @@ class BrowserWindow { // changed. virtual void UpdateDevTools() = 0; + // Tries to focus docked devtools window (when breakpoint is hit). + virtual void FocusDevTools() = 0; + // Update any loading animations running in the window. |should_animate| is // true if there are tabs loading and the animations should continue, false // if there are no active loads and the animations should end. diff --git a/chrome/browser/cocoa/browser_window_cocoa.h b/chrome/browser/cocoa/browser_window_cocoa.h index bc995c9..4d5da19 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.h +++ b/chrome/browser/cocoa/browser_window_cocoa.h @@ -40,6 +40,7 @@ class BrowserWindowCocoa : public BrowserWindow, virtual void SelectedTabToolbarSizeChanged(bool is_animating); virtual void UpdateTitleBar(); virtual void UpdateDevTools(); + virtual void FocusDevTools(); virtual void UpdateLoadingAnimations(bool should_animate); virtual void SetStarredState(bool is_starred); virtual gfx::Rect GetNormalBounds() const; diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm index c518571..2493a93 100644 --- a/chrome/browser/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/cocoa/browser_window_cocoa.mm @@ -104,6 +104,10 @@ void BrowserWindowCocoa::UpdateDevTools() { NOTIMPLEMENTED(); } +void BrowserWindowCocoa::FocusDevTools() { + NOTIMPLEMENTED(); +} + void BrowserWindowCocoa::UpdateLoadingAnimations(bool should_animate) { [controller_ updateLoadingAnimations:should_animate ? YES : NO]; } diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index 9c5705c..75fb4fe 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.cc @@ -127,8 +127,12 @@ void DevToolsWindow::Show() { } void DevToolsWindow::Activate() { - if (!docked_ && !browser_->window()->IsActive()) { - browser_->window()->Activate(); + if (!docked_) { + if (!browser_->window()->IsActive()) { + browser_->window()->Activate(); + } + } else { + inspected_window_->FocusDevTools(); } } diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 621adf0..de819b0 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -590,6 +590,10 @@ void BrowserWindowGtk::UpdateDevTools() { NOTIMPLEMENTED(); } +void BrowserWindowGtk::FocusDevTools() { + NOTIMPLEMENTED(); +} + void BrowserWindowGtk::UpdateLoadingAnimations(bool should_animate) { if (should_animate) { if (!loading_animation_timer_.IsRunning()) { diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index 42de7d7..8730a78 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -65,6 +65,7 @@ class BrowserWindowGtk : public BrowserWindow, virtual void SelectedTabToolbarSizeChanged(bool is_animating); virtual void UpdateTitleBar(); virtual void UpdateDevTools(); + virtual void FocusDevTools(); virtual void UpdateLoadingAnimations(bool should_animate); virtual void SetStarredState(bool is_starred); virtual gfx::Rect GetNormalBounds() const; diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 53b869b..079521a 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -668,6 +668,11 @@ void BrowserView::UpdateDevTools() { Layout(); } +void BrowserView::FocusDevTools() { + if (devtools_container_->IsVisible()) + GetRootView()->FocusView(devtools_container_->GetFocusView()); +} + void BrowserView::UpdateLoadingAnimations(bool should_animate) { if (should_animate) { if (!loading_animation_timer_.IsRunning()) { diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index fdb5f86..db2e3e8 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -204,6 +204,7 @@ class BrowserView : public BrowserWindow, virtual void SelectedTabToolbarSizeChanged(bool is_animating); virtual void UpdateTitleBar(); virtual void UpdateDevTools(); + virtual void FocusDevTools(); virtual void UpdateLoadingAnimations(bool should_animate); virtual void SetStarredState(bool is_starred); virtual gfx::Rect GetNormalBounds() const; |