summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser_window.h3
-rw-r--r--chrome/browser/cocoa/browser_window_cocoa.h1
-rw-r--r--chrome/browser/cocoa/browser_window_cocoa.mm4
-rw-r--r--chrome/browser/debugger/devtools_window.cc8
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc4
-rw-r--r--chrome/browser/gtk/browser_window_gtk.h1
-rw-r--r--chrome/browser/views/frame/browser_view.cc5
-rw-r--r--chrome/browser/views/frame/browser_view.h1
-rw-r--r--chrome/test/test_browser_window.h1
9 files changed, 26 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;
diff --git a/chrome/test/test_browser_window.h b/chrome/test/test_browser_window.h
index 33f739d..b0bfa9a 100644
--- a/chrome/test/test_browser_window.h
+++ b/chrome/test/test_browser_window.h
@@ -34,6 +34,7 @@ class TestBrowserWindow : 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 { return gfx::Rect(); }