diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 21:27:28 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 21:27:28 +0000 |
commit | 90daadb496f6e589f533fbd2fe3727cf86204f82 (patch) | |
tree | 59304e0a7ae87410a70eb9d4a7ab1412c38220c5 /chrome/browser/tab_contents | |
parent | c55afea2eec383549358d934e19b29d78fd4e41b (diff) | |
download | chromium_src-90daadb496f6e589f533fbd2fe3727cf86204f82.zip chromium_src-90daadb496f6e589f533fbd2fe3727cf86204f82.tar.gz chromium_src-90daadb496f6e589f533fbd2fe3727cf86204f82.tar.bz2 |
Rename the TabContents::SetInitialFocus(reverse) method to TabContents::FocusThroughTabTraversal(reverse), as SetInitialiFocus can be easily confused with TabContentView::SetInitialFocus().
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/118392
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-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 |
5 files changed, 14 insertions, 18 deletions
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; } |