summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 21:22:03 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 21:22:03 +0000
commit914c69f33f38bb472e5cbf8a3ab1cb3ee3a2948e (patch)
tree2d7fa294dc42a0dcb41242ae82f34c414418a1d5 /chrome/browser/dom_ui
parent389f493751d6edde8321e18ff8b9558a72598c9e (diff)
downloadchromium_src-914c69f33f38bb472e5cbf8a3ab1cb3ee3a2948e.zip
chromium_src-914c69f33f38bb472e5cbf8a3ab1cb3ee3a2948e.tar.gz
chromium_src-914c69f33f38bb472e5cbf8a3ab1cb3ee3a2948e.tar.bz2
The new history and download tab caused a regression where opening the NTP would not focus the location bar.
DOM UI now by default focus the page. The NTP one focus the location bar. Also removed some unused fields from the history and download DOM UI. BUG=8356 TEST=Open NTP, focus should be on location bar Review URL: http://codereview.chromium.org/39173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11034 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/dom_ui.cc4
-rw-r--r--chrome/browser/dom_ui/dom_ui.h4
-rw-r--r--chrome/browser/dom_ui/dom_ui_contents.cc6
-rw-r--r--chrome/browser/dom_ui/dom_ui_contents.h2
-rw-r--r--chrome/browser/dom_ui/downloads_ui.h1
-rw-r--r--chrome/browser/dom_ui/history_ui.h1
6 files changed, 6 insertions, 12 deletions
diff --git a/chrome/browser/dom_ui/dom_ui.cc b/chrome/browser/dom_ui/dom_ui.cc
index 1f01e7d..98a88e1 100644
--- a/chrome/browser/dom_ui/dom_ui.cc
+++ b/chrome/browser/dom_ui/dom_ui.cc
@@ -79,10 +79,6 @@ void DOMUI::RegisterMessageCallback(const std::string &message,
message_callbacks_.insert(std::make_pair(message, callback));
}
-void DOMUI::SetInitialFocus(bool reverse) {
- get_contents()->render_view_host()->SetInitialFocus(reverse);
-}
-
void DOMUI::RequestOpenURL(const GURL& url,
const GURL& /* referer */,
WindowOpenDisposition disposition) {
diff --git a/chrome/browser/dom_ui/dom_ui.h b/chrome/browser/dom_ui/dom_ui.h
index 35388bd..1d59bfc 100644
--- a/chrome/browser/dom_ui/dom_ui.h
+++ b/chrome/browser/dom_ui/dom_ui.h
@@ -50,8 +50,8 @@ class DOMUI {
virtual bool ShouldDisplayFavIcon() { return true; }
// No special bookmark bar behavior
virtual bool IsBookmarkBarAlwaysVisible() { return false; }
- // When NTP gets the initial focus, focus the URL bar.
- virtual void SetInitialFocus(bool reverse);
+ // Defaults to focusing the page.
+ virtual void SetInitialFocus() { contents_->Focus(); }
// Whether we want to display the page's URL.
virtual bool ShouldDisplayURL() { return true; }
// Hide the referrer.
diff --git a/chrome/browser/dom_ui/dom_ui_contents.cc b/chrome/browser/dom_ui/dom_ui_contents.cc
index d4fab0a..eda9fb9 100644
--- a/chrome/browser/dom_ui/dom_ui_contents.cc
+++ b/chrome/browser/dom_ui/dom_ui_contents.cc
@@ -190,11 +190,11 @@ bool DOMUIContents::IsBookmarkBarAlwaysVisible() {
return false;
}
-void DOMUIContents::SetInitialFocus(bool reverse) {
+void DOMUIContents::SetInitialFocus() {
if (InitCurrentUI(false))
- current_ui_->SetInitialFocus(reverse);
+ current_ui_->SetInitialFocus();
else
- TabContents::SetInitialFocus(reverse);
+ TabContents::SetInitialFocus();
}
const string16& DOMUIContents::GetTitle() const {
diff --git a/chrome/browser/dom_ui/dom_ui_contents.h b/chrome/browser/dom_ui/dom_ui_contents.h
index 42bfe89..3c8e985 100644
--- a/chrome/browser/dom_ui/dom_ui_contents.h
+++ b/chrome/browser/dom_ui/dom_ui_contents.h
@@ -106,7 +106,7 @@ class DOMUIContents : public WebContents {
// The bookmark bar is always visible on the new tab.
virtual bool IsBookmarkBarAlwaysVisible();
// When NTP gets the initial focus, focus the URL bar.
- virtual void SetInitialFocus(bool reverse);
+ virtual void SetInitialFocus();
// Whether we want to display the page's URL.
virtual bool ShouldDisplayURL();
// Get the title for this page.
diff --git a/chrome/browser/dom_ui/downloads_ui.h b/chrome/browser/dom_ui/downloads_ui.h
index 9209000..c11ce8d 100644
--- a/chrome/browser/dom_ui/downloads_ui.h
+++ b/chrome/browser/dom_ui/downloads_ui.h
@@ -114,7 +114,6 @@ class DownloadsUI : public DOMUI {
virtual void Init();
private:
- DOMUIContents* contents_;
DISALLOW_COPY_AND_ASSIGN(DownloadsUI);
};
diff --git a/chrome/browser/dom_ui/history_ui.h b/chrome/browser/dom_ui/history_ui.h
index 0902322..38ccc3a 100644
--- a/chrome/browser/dom_ui/history_ui.h
+++ b/chrome/browser/dom_ui/history_ui.h
@@ -93,7 +93,6 @@ class HistoryUI : public DOMUI {
virtual void Init();
private:
- DOMUIContents* contents_;
DISALLOW_COPY_AND_ASSIGN(HistoryUI);
};