summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/blocked_popup_container.h4
-rw-r--r--chrome/browser/browser.cc12
-rw-r--r--chrome/browser/browser.h3
-rw-r--r--chrome/browser/debugger/devtools_window.h1
-rw-r--r--chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc5
-rw-r--r--chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h1
-rw-r--r--chrome/browser/external_tab_container_win.cc3
-rw-r--r--chrome/browser/external_tab_container_win.h1
-rw-r--r--chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc4
-rw-r--r--chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h1
-rw-r--r--chrome/browser/sidebar/sidebar_container.h1
-rw-r--r--chrome/browser/tab_contents/match_preview.cc1
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc5
-rw-r--r--chrome/browser/tab_contents/tab_contents.h3
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.cc6
-rw-r--r--chrome/browser/tab_contents/tab_contents_delegate.h9
-rw-r--r--chrome/browser/tab_contents/tab_contents_view.cc4
-rw-r--r--chrome/browser/views/app_launcher.h1
-rw-r--r--chrome/browser/views/tabs/dragged_tab_controller.cc4
-rw-r--r--chrome/browser/views/tabs/dragged_tab_controller.h1
-rw-r--r--chrome/renderer/render_view.cc18
-rw-r--r--chrome/renderer/render_view.h2
-rw-r--r--chrome/renderer/render_widget.cc2
23 files changed, 26 insertions, 66 deletions
diff --git a/chrome/browser/blocked_popup_container.h b/chrome/browser/blocked_popup_container.h
index 8fbd31a..04565de 100644
--- a/chrome/browser/blocked_popup_container.h
+++ b/chrome/browser/blocked_popup_container.h
@@ -60,10 +60,8 @@ class BlockedPopupContainer : public TabContentsDelegate {
const gfx::Rect& initial_position,
bool user_gesture);
- // Ignore activation/deactivation requests from the TabContents we're
- // blocking.
+ // Ignore activation requests from the TabContents we're blocking.
virtual void ActivateContents(TabContents* contents) {}
- virtual void DeactivateContents(TabContents* contents) {}
// Ignored; BlockedPopupContainer doesn't display a throbber.
virtual void LoadingStateChanged(TabContents* source) {}
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index e4a5f8c..f8c91744 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -2659,10 +2659,6 @@ void Browser::ActivateContents(TabContents* contents) {
window_->Activate();
}
-void Browser::DeactivateContents(TabContents* contents) {
- window_->Deactivate();
-}
-
void Browser::LoadingStateChanged(TabContents* source) {
window_->UpdateLoadingAnimations(tabstrip_model_.TabsAreLoading());
window_->UpdateTitleBar();
@@ -2806,6 +2802,14 @@ bool Browser::TakeFocus(bool reverse) {
return false;
}
+void Browser::Activate() {
+ window_->Activate();
+}
+
+void Browser::Deactivate() {
+ window_->Deactivate();
+}
+
bool Browser::IsApplication() const {
return (type_ & TYPE_APP) != 0;
}
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 3213795..5f9a23c 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -703,7 +703,6 @@ class Browser : public TabStripModelDelegate,
const gfx::Rect& initial_pos,
bool user_gesture);
virtual void ActivateContents(TabContents* contents);
- virtual void DeactivateContents(TabContents* contents);
virtual void LoadingStateChanged(TabContents* source);
virtual void CloseContents(TabContents* source);
virtual void MoveContents(TabContents* source, const gfx::Rect& pos);
@@ -720,6 +719,8 @@ class Browser : public TabStripModelDelegate,
virtual void SetTabContentBlocked(TabContents* contents, bool blocked);
virtual void TabContentsFocused(TabContents* tab_content);
virtual bool TakeFocus(bool reverse);
+ virtual void Activate();
+ virtual void Deactivate();
virtual bool IsApplication() const;
virtual void ConvertContentsToApplication(TabContents* source);
virtual bool ShouldDisplayURLField();
diff --git a/chrome/browser/debugger/devtools_window.h b/chrome/browser/debugger/devtools_window.h
index 89914a6..9c19982 100644
--- a/chrome/browser/debugger/devtools_window.h
+++ b/chrome/browser/debugger/devtools_window.h
@@ -83,7 +83,6 @@ class DevToolsWindow
const gfx::Rect& initial_pos,
bool user_gesture) {}
virtual void ActivateContents(TabContents* contents) {}
- virtual void DeactivateContents(TabContents* contents) {}
virtual void LoadingStateChanged(TabContents* source) {}
virtual void CloseContents(TabContents* source) {}
virtual void MoveContents(TabContents* source, const gfx::Rect& pos) {}
diff --git a/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc b/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc
index be32f7f..8bec35f 100644
--- a/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc
+++ b/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.cc
@@ -76,11 +76,6 @@ void HtmlDialogTabContentsDelegate::ActivateContents(TabContents* contents) {
// this frame and we don't have a TabStripModel.
}
-void HtmlDialogTabContentsDelegate::DeactivateContents(TabContents* contents) {
- // We don't care about this notification (called when a user gesture triggers
- // a call to window.blur()).
-}
-
void HtmlDialogTabContentsDelegate::LoadingStateChanged(TabContents* source) {
// We don't care about this notification.
}
diff --git a/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h b/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h
index 4b68a9f..1c5cca0 100644
--- a/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h
+++ b/chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h
@@ -48,7 +48,6 @@ class HtmlDialogTabContentsDelegate : public TabContentsDelegate {
const gfx::Rect& initial_pos,
bool user_gesture);
virtual void ActivateContents(TabContents* contents);
- virtual void DeactivateContents(TabContents* contents);
virtual void LoadingStateChanged(TabContents* source);
virtual void CloseContents(TabContents* source);
virtual bool IsPopup(const TabContents* source) const;
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index 8e374c8..59da688 100644
--- a/chrome/browser/external_tab_container_win.cc
+++ b/chrome/browser/external_tab_container_win.cc
@@ -403,9 +403,6 @@ bool ExternalTabContainer::infobars_enabled() {
void ExternalTabContainer::ActivateContents(TabContents* contents) {
}
-void ExternalTabContainer::DeactivateContents(TabContents* contents) {
-}
-
void ExternalTabContainer::LoadingStateChanged(TabContents* source) {
}
diff --git a/chrome/browser/external_tab_container_win.h b/chrome/browser/external_tab_container_win.h
index 591a1ff..443b3e8 100644
--- a/chrome/browser/external_tab_container_win.h
+++ b/chrome/browser/external_tab_container_win.h
@@ -117,7 +117,6 @@ class ExternalTabContainer : public TabContentsDelegate,
const gfx::Rect& initial_pos,
bool user_gesture);
virtual void ActivateContents(TabContents* contents);
- virtual void DeactivateContents(TabContents* contents);
virtual void LoadingStateChanged(TabContents* source);
virtual void CloseContents(TabContents* source);
virtual void MoveContents(TabContents* source, const gfx::Rect& pos);
diff --git a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
index 551aeb8..64c314d 100644
--- a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
+++ b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
@@ -146,10 +146,6 @@ void DraggedTabControllerGtk::ActivateContents(TabContents* contents) {
// Ignored.
}
-void DraggedTabControllerGtk::DeactivateContents(TabContents* contents) {
- // Ignored.
-}
-
void DraggedTabControllerGtk::LoadingStateChanged(TabContents* source) {
// TODO(jhawkins): It would be nice to respond to this message by changing the
// screen shot in the dragged tab.
diff --git a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h
index b8b8eb3..a9fba9d 100644
--- a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h
+++ b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h
@@ -82,7 +82,6 @@ class DraggedTabControllerGtk : public NotificationObserver,
const gfx::Rect& initial_pos,
bool user_gesture);
virtual void ActivateContents(TabContents* contents);
- virtual void DeactivateContents(TabContents* contents);
virtual void LoadingStateChanged(TabContents* source);
virtual void CloseContents(TabContents* source);
virtual void MoveContents(TabContents* source, const gfx::Rect& pos);
diff --git a/chrome/browser/sidebar/sidebar_container.h b/chrome/browser/sidebar/sidebar_container.h
index 9d9eb82..152331d 100644
--- a/chrome/browser/sidebar/sidebar_container.h
+++ b/chrome/browser/sidebar/sidebar_container.h
@@ -104,7 +104,6 @@ class SidebarContainer
const gfx::Rect& initial_pos,
bool user_gesture) {}
virtual void ActivateContents(TabContents* contents) {}
- virtual void DeactivateContents(TabContents* contents) {}
virtual void LoadingStateChanged(TabContents* source) {}
virtual void CloseContents(TabContents* source) {}
virtual void MoveContents(TabContents* source, const gfx::Rect& pos) {}
diff --git a/chrome/browser/tab_contents/match_preview.cc b/chrome/browser/tab_contents/match_preview.cc
index 4a05856..c8a8c21 100644
--- a/chrome/browser/tab_contents/match_preview.cc
+++ b/chrome/browser/tab_contents/match_preview.cc
@@ -37,7 +37,6 @@ class MatchPreview::TabContentsDelegateImpl : public TabContentsDelegate {
virtual void ActivateContents(TabContents* contents) {
match_preview_->CommitCurrentPreview();
}
- virtual void DeactivateContents(TabContents* contents) {}
virtual void LoadingStateChanged(TabContents* source) {}
virtual void CloseContents(TabContents* source) {}
virtual void MoveContents(TabContents* source, const gfx::Rect& pos) {}
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index a9e5524..d12434c 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -815,11 +815,6 @@ void TabContents::Activate() {
delegate_->ActivateContents(this);
}
-void TabContents::Deactivate() {
- if (delegate_)
- delegate_->DeactivateContents(this);
-}
-
void TabContents::ShowContents() {
RenderWidgetHostView* rwhv = GetRenderWidgetHostView();
if (rwhv)
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index c852a14..4fafde2 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -325,9 +325,6 @@ class TabContents : public PageNavigator,
// to the foreground if necessary.
void Activate();
- // Deactivates this contents by deactivating its containing window.
- void Deactivate();
-
// TODO(brettw) document these.
virtual void ShowContents();
virtual void HideContents();
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.cc b/chrome/browser/tab_contents/tab_contents_delegate.cc
index aca5fc6..f19422b 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.cc
+++ b/chrome/browser/tab_contents/tab_contents_delegate.cc
@@ -70,6 +70,12 @@ bool TabContentsDelegate::TakeFocus(bool reverse) {
return false;
}
+void TabContentsDelegate::Activate() {
+}
+
+void TabContentsDelegate::Deactivate(){
+}
+
void TabContentsDelegate::SetTabContentBlocked(
TabContents* contents, bool blocked) {
}
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h
index 921c9a7..2a31508 100644
--- a/chrome/browser/tab_contents/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents/tab_contents_delegate.h
@@ -68,10 +68,6 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
// Selects the specified contents, bringing its container to the front.
virtual void ActivateContents(TabContents* contents) = 0;
- // Deactivates the specified contents by deactivating its container and
- // potentialy moving it to the back of the Z order.
- virtual void DeactivateContents(TabContents* contents) = 0;
-
// Notifies the delegate that this contents is starting or is done loading
// some resource. The delegate should use this notification to represent
// loading feedback. See TabContents::is_loading()
@@ -183,6 +179,11 @@ class TabContentsDelegate : public AutomationResourceRoutingDelegate {
// this. Returns true if the delegate successfully handled it.
virtual bool TakeFocus(bool reverse);
+ // Called by WebKit to notify that the page requested the tab hosting window
+ // to be activated/deactivated (by calling window.focus()/blur()).
+ virtual void Activate();
+ virtual void Deactivate();
+
// Changes the blocked state of the tab at |index|. TabContents are
// considered blocked while displaying a tab modal dialog. During that time
// renderer host will ignore any UI interaction within TabContent outside of
diff --git a/chrome/browser/tab_contents/tab_contents_view.cc b/chrome/browser/tab_contents/tab_contents_view.cc
index 9c369d0..c08d1b7 100644
--- a/chrome/browser/tab_contents/tab_contents_view.cc
+++ b/chrome/browser/tab_contents/tab_contents_view.cc
@@ -72,11 +72,11 @@ void TabContentsView::ShowCreatedWidget(int route_id,
}
void TabContentsView::Activate() {
- tab_contents_->Activate();
+ tab_contents_->delegate()->Activate();
}
void TabContentsView::Deactivate() {
- tab_contents_->Deactivate();
+ tab_contents_->delegate()->Deactivate();
}
void TabContentsView::ShowCreatedFullscreenWidget(int route_id) {
diff --git a/chrome/browser/views/app_launcher.h b/chrome/browser/views/app_launcher.h
index 2f99ec8..71038e3 100644
--- a/chrome/browser/views/app_launcher.h
+++ b/chrome/browser/views/app_launcher.h
@@ -86,7 +86,6 @@ class AppLauncher : public AnimationDelegate,
const gfx::Rect& initial_pos,
bool user_gesture);
virtual void ActivateContents(TabContents* contents) {}
- virtual void DeactivateContents(TabContents* contents) {}
virtual void LoadingStateChanged(TabContents* source) {}
virtual void CloseContents(TabContents* source) {}
virtual void MoveContents(TabContents* source, const gfx::Rect& pos) {}
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc
index b0dc9e3..8ee4259 100644
--- a/chrome/browser/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/views/tabs/dragged_tab_controller.cc
@@ -429,10 +429,6 @@ void DraggedTabController::ActivateContents(TabContents* contents) {
// Ignored.
}
-void DraggedTabController::DeactivateContents(TabContents* contents) {
- // Ignored.
-}
-
void DraggedTabController::LoadingStateChanged(TabContents* source) {
// It would be nice to respond to this message by changing the
// screen shot in the dragged tab.
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.h b/chrome/browser/views/tabs/dragged_tab_controller.h
index 5c9c619..4c2c66d 100644
--- a/chrome/browser/views/tabs/dragged_tab_controller.h
+++ b/chrome/browser/views/tabs/dragged_tab_controller.h
@@ -104,7 +104,6 @@ class DraggedTabController : public TabContentsDelegate,
const gfx::Rect& initial_pos,
bool user_gesture);
virtual void ActivateContents(TabContents* contents);
- virtual void DeactivateContents(TabContents* contents);
virtual void LoadingStateChanged(TabContents* source);
virtual void CloseContents(TabContents* source);
virtual void MoveContents(TabContents* source, const gfx::Rect& pos);
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 6feb581..2e66fc7 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2222,24 +2222,6 @@ void RenderView::didAcceptAutocompleteSuggestion(
// WebKit::WebWidgetClient ----------------------------------------------------
-void RenderView::didFocus() {
- // TODO(jcivelli): when https://bugs.webkit.org/show_bug.cgi?id=33389 is fixed
- // we won't have to test for user gesture anymore and we can
- // move that code back to render_widget.cc
- if (webview() && webview()->mainFrame() &&
- webview()->mainFrame()->isProcessingUserGesture()) {
- Send(new ViewHostMsg_Focus(routing_id_));
- }
-}
-
-void RenderView::didBlur() {
- // TODO(jcivelli): see TODO above in didFocus().
- if (webview() && webview()->mainFrame() &&
- webview()->mainFrame()->isProcessingUserGesture()) {
- Send(new ViewHostMsg_Blur(routing_id_));
- }
-}
-
// We are supposed to get a single call to Show for a newly created RenderView
// that was created via RenderView::CreateWebView. So, we wait until this
// point to dispatch the ShowView message.
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 29a5430..7000d2a 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -310,8 +310,6 @@ class RenderView : public RenderWidget,
// WebKit::WebWidgetClient implementation ------------------------------------
// Most methods are handled by RenderWidget.
- virtual void didFocus();
- virtual void didBlur();
virtual void show(WebKit::WebNavigationPolicy policy);
virtual void closeWidgetSoon();
virtual void runModal();
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 9111391..7b14ccd 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -655,9 +655,11 @@ void RenderWidget::show(WebNavigationPolicy) {
}
void RenderWidget::didFocus() {
+ Send(new ViewHostMsg_Focus(routing_id_));
}
void RenderWidget::didBlur() {
+ Send(new ViewHostMsg_Blur(routing_id_));
}
void RenderWidget::DoDeferredClose() {