summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-12 20:29:04 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-12 20:29:04 +0000
commitc744f7d2acf1b35e531860bf655714dc901d148f (patch)
tree2a8a253ec0c4c392df66e7543d504588e0984a87 /content/browser
parenta3eb0a237280b3942288f82fcb7174c1283bf9ee (diff)
downloadchromium_src-c744f7d2acf1b35e531860bf655714dc901d148f.zip
chromium_src-c744f7d2acf1b35e531860bf655714dc901d148f.tar.gz
chromium_src-c744f7d2acf1b35e531860bf655714dc901d148f.tar.bz2
Remove some chrome-specific methods from content::WebUI.
HideFavicon wasn't used anymore. This is probably because now we show a search icon there. FocusLocationBarByDefault can just be implemented in Browser (like Instant). HideURL can just be implemented in ToolbarModelImpl (again, like Instant). Review URL: https://codereview.chromium.org/14080004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193998 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/web_contents/web_contents_impl.cc43
-rw-r--r--content/browser/web_contents/web_contents_impl.h1
-rw-r--r--content/browser/webui/web_ui_impl.cc29
-rw-r--r--content/browser/webui/web_ui_impl.h9
4 files changed, 1 insertions, 81 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index dd65920..f9f9688 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1905,46 +1905,6 @@ int WebContentsImpl::GetContentRestrictions() const {
return content_restrictions_;
}
-WebUI* WebContentsImpl::GetWebUIForCurrentState() {
- // When there is a pending navigation entry, we want to use the pending WebUI
- // that goes along with it to control the basic flags. For example, we want to
- // show the pending URL in the URL bar, so we want the display_url flag to
- // be from the pending entry.
- //
- // The confusion comes because there are multiple possibilities for the
- // initial load in a tab as a side effect of the way the RenderViewHostManager
- // works.
- //
- // - For the very first tab the load looks "normal". The new tab Web UI is
- // the pending one, and we want it to apply here.
- //
- // - For subsequent new tabs, they'll get a new SiteInstance which will then
- // get switched to the one previously associated with the new tab pages.
- // This switching will cause the manager to commit the RVH/WebUI. So we'll
- // have a committed Web UI in this case.
- //
- // This condition handles all of these cases:
- //
- // - First load in first tab: no committed nav entry + pending nav entry +
- // pending dom ui:
- // -> Use pending Web UI if any.
- //
- // - First load in second tab: no committed nav entry + pending nav entry +
- // no pending Web UI:
- // -> Use the committed Web UI if any.
- //
- // - Second navigation in any tab: committed nav entry + pending nav entry:
- // -> Use pending Web UI if any.
- //
- // - Normal state with no load: committed nav entry + no pending nav entry:
- // -> Use committed Web UI.
- if (controller_.GetPendingEntry() &&
- (controller_.GetLastCommittedEntry() ||
- render_manager_.pending_web_ui()))
- return render_manager_.pending_web_ui();
- return render_manager_.web_ui();
-}
-
bool WebContentsImpl::GotResponseToLockMouseRequest(bool allowed) {
return GetRenderViewHost() ?
GetRenderViewHostImpl()->GotResponseToLockMouseRequest(allowed) : false;
@@ -1978,9 +1938,6 @@ int WebContentsImpl::DownloadImage(const GURL& url,
}
bool WebContentsImpl::FocusLocationBarByDefault() {
- WebUI* web_ui = GetWebUIForCurrentState();
- if (web_ui)
- return web_ui->ShouldFocusLocationBarByDefault();
NavigationEntry* entry = controller_.GetActiveEntry();
if (entry && entry->GetURL() == GURL(chrome::kAboutBlankURL))
return true;
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 9dbf0a2..3e7ea78 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -259,7 +259,6 @@ class CONTENT_EXPORT WebContentsImpl
virtual int GetMaximumZoomPercent() const OVERRIDE;
virtual gfx::Size GetPreferredSize() const OVERRIDE;
virtual int GetContentRestrictions() const OVERRIDE;
- virtual WebUI* GetWebUIForCurrentState() OVERRIDE;
virtual bool GotResponseToLockMouseRequest(bool allowed) OVERRIDE;
virtual bool HasOpener() const OVERRIDE;
virtual void DidChooseColorInColorChooser(int color_chooser_id,
diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc
index 5155702..88b181b 100644
--- a/content/browser/webui/web_ui_impl.cc
+++ b/content/browser/webui/web_ui_impl.cc
@@ -45,10 +45,7 @@ string16 WebUI::GetJavascriptCall(
}
WebUIImpl::WebUIImpl(WebContents* contents)
- : hide_favicon_(false),
- focus_location_bar_by_default_(false),
- should_hide_url_(false),
- link_transition_type_(PAGE_TRANSITION_LINK),
+ : link_transition_type_(PAGE_TRANSITION_LINK),
bindings_(BINDINGS_POLICY_WEB_UI),
web_contents_(contents) {
DCHECK(contents);
@@ -111,30 +108,6 @@ ui::ScaleFactor WebUIImpl::GetDeviceScaleFactor() const {
return GetScaleFactorForView(web_contents_->GetRenderWidgetHostView());
}
-bool WebUIImpl::ShouldHideFavicon() const {
- return hide_favicon_;
-}
-
-void WebUIImpl::HideFavicon() {
- hide_favicon_ = true;
-}
-
-bool WebUIImpl::ShouldFocusLocationBarByDefault() const {
- return focus_location_bar_by_default_;
-}
-
-void WebUIImpl::FocusLocationBarByDefault() {
- focus_location_bar_by_default_ = true;
-}
-
-bool WebUIImpl::ShouldHideURL() const {
- return should_hide_url_;
-}
-
-void WebUIImpl::HideURL() {
- should_hide_url_ = true;
-}
-
const string16& WebUIImpl::GetOverriddenTitle() const {
return overridden_title_;
}
diff --git a/content/browser/webui/web_ui_impl.h b/content/browser/webui/web_ui_impl.h
index 49d9b4b..1be3674 100644
--- a/content/browser/webui/web_ui_impl.h
+++ b/content/browser/webui/web_ui_impl.h
@@ -32,12 +32,6 @@ class CONTENT_EXPORT WebUIImpl : public WebUI,
virtual WebUIController* GetController() const OVERRIDE;
virtual void SetController(WebUIController* controller) OVERRIDE;
virtual ui::ScaleFactor GetDeviceScaleFactor() const OVERRIDE;
- virtual bool ShouldHideFavicon() const OVERRIDE;
- virtual void HideFavicon() OVERRIDE;
- virtual bool ShouldFocusLocationBarByDefault() const OVERRIDE;
- virtual void FocusLocationBarByDefault() OVERRIDE;
- virtual bool ShouldHideURL() const OVERRIDE;
- virtual void HideURL() OVERRIDE;
virtual const string16& GetOverriddenTitle() const OVERRIDE;
virtual void OverrideTitle(const string16& title) OVERRIDE;
virtual PageTransition GetLinkTransitionType() const OVERRIDE;
@@ -91,9 +85,6 @@ class CONTENT_EXPORT WebUIImpl : public WebUI,
// Options that may be overridden by individual Web UI implementations. The
// bool options default to false. See the public getters for more information.
- bool hide_favicon_;
- bool focus_location_bar_by_default_;
- bool should_hide_url_;
string16 overridden_title_; // Defaults to empty string.
PageTransition link_transition_type_; // Defaults to LINK.
int bindings_; // The bindings from BindingsPolicy that should be enabled for