diff options
-rwxr-xr-x | chrome/browser/automation/automation_provider.cc | 2 | ||||
-rw-r--r-- | chrome/browser/external_tab_container.cc | 7 | ||||
-rw-r--r-- | chrome/browser/external_tab_container.h | 4 | ||||
-rw-r--r-- | chrome/browser/tab_contents/interstitial_page.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/interstitial_page.h | 5 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 16 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/views/tab_contents/native_tab_contents_container_win.cc | 5 |
9 files changed, 23 insertions, 27 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 61f204a..dcb6afe 100755 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -2509,7 +2509,7 @@ void AutomationProvider::SetInitialFocus(const IPC::Message& message, #if defined(OS_WIN) ExternalTabContainer* external_tab = GetExternalTabForHandle(handle); if (external_tab) { - external_tab->SetInitialFocus(reverse); + external_tab->FocusThroughTabTraversal(reverse); } // This message expects no response. #elif defined(OS_POSIX) diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index 70c3eaf..14ee79e 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -114,11 +114,11 @@ void ExternalTabContainer::ProcessUnhandledAccelerator(const MSG& msg) { DispatchMessage(&msg); } -void ExternalTabContainer::SetInitialFocus(bool reverse) { +void ExternalTabContainer::FocusThroughTabTraversal(bool reverse) { DCHECK(tab_contents_); if (tab_contents_) { static_cast<TabContents*>(tab_contents_)->Focus(); - static_cast<TabContents*>(tab_contents_)->SetInitialFocus(reverse); + static_cast<TabContents*>(tab_contents_)->FocusThroughTabTraversal(reverse); } } @@ -126,7 +126,7 @@ void ExternalTabContainer::SetInitialFocus(bool reverse) { bool ExternalTabContainer::IsExternalTabContainer(HWND window) { if (GetProp(window, kWindowObjectKey) != NULL) return true; - + return false; } @@ -378,4 +378,3 @@ void ExternalTabContainer::Uninitialize(HWND window) { tab_contents_ = NULL; } } - diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h index 4edb8b9..3d65321 100644 --- a/chrome/browser/external_tab_container.h +++ b/chrome/browser/external_tab_container.h @@ -44,8 +44,8 @@ class ExternalTabContainer : public TabContentsDelegate, // message it did not process void ProcessUnhandledAccelerator(const MSG& msg); - // See TabContents::SetInitialFocus. Called from AutomationProvider. - void SetInitialFocus(bool reverse); + // See TabContents::FocusThroughTabTraversal. Called from AutomationProvider. + void FocusThroughTabTraversal(bool reverse); // A helper method that tests whether the given window is an // ExternalTabContainer window diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index 2f644e9..fc0ce6c 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -362,7 +362,7 @@ void InterstitialPage::Focus() { render_view_host_->view()->Focus(); } -void InterstitialPage::SetInitialFocus(bool reverse) { +void InterstitialPage::FocusThroughTabTraversal(bool reverse) { render_view_host_->SetInitialFocus(reverse); } diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h index 5ce1e9e..821171d 100644 --- a/chrome/browser/tab_contents/interstitial_page.h +++ b/chrome/browser/tab_contents/interstitial_page.h @@ -80,8 +80,9 @@ class InterstitialPage : public NotificationObserver, // Sets the focus to the interstitial. void Focus(); - // Sets the focus to the interstitial. Called when tab traversing. - void SetInitialFocus(bool reverse); + // Focus the first (last if reverse is true) element in the interstitial page. + // Called when tab traversing. + void FocusThroughTabTraversal(bool reverse); protected: // NotificationObserver method: diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 754c9e9..ddf2b9d 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -819,7 +819,7 @@ void TabContents::Focus() { view_->Focus(); } -void TabContents::SetInitialFocus(bool reverse) { +void TabContents::FocusThroughTabTraversal(bool reverse) { render_view_host()->SetInitialFocus(reverse); } diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 522f44d..92a67bc 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -362,19 +362,13 @@ class TabContents : public PageNavigator, // Returns the bounds of this TabContents in the screen coordinate system. void GetContainerBounds(gfx::Rect *out) const; - // Make the tab the focused window. + // Makes the tab the focused window. void Focus(); - // Invoked the first time this tab is getting the focus through TAB traversal. - // By default this does nothing, but is overridden to set the focus for the - // first element in the page. - // - // |reverse| indicates if the user is going forward or backward, so we know - // whether to set the first or last element focus. - // - // See also SetInitialFocus(no arg). - // FIXME(brettw) having two SetInitialFocus that do different things is silly. - void SetInitialFocus(bool reverse); + // Focuses the first (last if |reverse| is true) element in the page. + // Invoked when this tab is getting the focus through tab traversal (|reverse| + // is true when using Shift-Tab). + void FocusThroughTabTraversal(bool reverse); // Returns true if the location bar should be focused by default rather than // the page contents. The view calls this function when the tab is focused diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc index d18edbc..fd00d82 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc @@ -30,8 +30,9 @@ namespace { // Called when the content view gtk widget is tabbed to, or after the call to // gtk_widget_child_focus() in TakeFocus(). We return true -// and grab focus if we don't have it. The call to SetInitialFocus(bool) -// forwards the "move focus forward" effect to webkit. +// and grab focus if we don't have it. The call to +// FocusThroughTabTraversal(bool) forwards the "move focus forward" effect to +// webkit. gboolean OnFocus(GtkWidget* widget, GtkDirectionType focus, TabContents* tab_contents) { // If we already have focus, let the next widget have a shot at it. We will @@ -42,7 +43,7 @@ gboolean OnFocus(GtkWidget* widget, GtkDirectionType focus, gtk_widget_grab_focus(widget); bool reverse = focus == GTK_DIR_TAB_BACKWARD; - tab_contents->SetInitialFocus(reverse); + tab_contents->FocusThroughTabTraversal(reverse); return TRUE; } diff --git a/chrome/browser/views/tab_contents/native_tab_contents_container_win.cc b/chrome/browser/views/tab_contents/native_tab_contents_container_win.cc index eaecb12..800bb54 100644 --- a/chrome/browser/views/tab_contents/native_tab_contents_container_win.cc +++ b/chrome/browser/views/tab_contents/native_tab_contents_container_win.cc @@ -148,10 +148,11 @@ void NativeTabContentsContainerWin::AboutToRequestFocusFromTabTraversal( return; // Give an opportunity to the tab to reset its focus. if (container_->tab_contents()->interstitial_page()) { - container_->tab_contents()->interstitial_page()->SetInitialFocus(reverse); + container_->tab_contents()->interstitial_page()-> + FocusThroughTabTraversal(reverse); return; } - container_->tab_contents()->SetInitialFocus(reverse); + container_->tab_contents()->FocusThroughTabTraversal(reverse); } bool NativeTabContentsContainerWin::GetAccessibleRole( |