diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 04:42:08 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 04:42:08 +0000 |
commit | b5cca98eb4857dfd170c3f2427cbcc2a1189cd06 (patch) | |
tree | 16dfe96571c4262714e57dd3659fb12cc9fc3f65 /content | |
parent | 22e0af9993d8e6cdf6385f0b900889e93690e874 (diff) | |
download | chromium_src-b5cca98eb4857dfd170c3f2427cbcc2a1189cd06.zip chromium_src-b5cca98eb4857dfd170c3f2427cbcc2a1189cd06.tar.gz chromium_src-b5cca98eb4857dfd170c3f2427cbcc2a1189cd06.tar.bz2 |
Remove the last prefs code from content. I tried hard to move ShouldShowBookmarkBar out of TabContents, but this looked very tricky so I've punted and filed http://crbug.com/83975 to track that.
BUG=76697
Review URL: http://codereview.chromium.org/7068034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/DEPS | 5 | ||||
-rw-r--r-- | content/browser/content_browser_client.cc | 4 | ||||
-rw-r--r-- | content/browser/content_browser_client.h | 4 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents.cc | 20 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents.h | 1 |
5 files changed, 13 insertions, 21 deletions
diff --git a/content/browser/DEPS b/content/browser/DEPS index 9991d2d..71e4407 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS @@ -17,8 +17,6 @@ include_rules = [ "+chrome/browser/debugger/devtools_manager.h",
"+chrome/browser/debugger/devtools_netlog_observer.h",
- "+chrome/browser/defaults.h",
-
# http://crbug.com/82782
"+chrome/browser/download/download_file_manager.h",
"+chrome/browser/download/download_manager.h",
@@ -48,9 +46,6 @@ include_rules = [ "+chrome/browser/platform_util.h",
- "+chrome/browser/prefs/pref_service.h",
- "+chrome/common/pref_names.h",
-
# http://crbug.com/76788
"+chrome/browser/profiles/profile.h",
diff --git a/content/browser/content_browser_client.cc b/content/browser/content_browser_client.cc index b35096e..79759d3 100644 --- a/content/browser/content_browser_client.cc +++ b/content/browser/content_browser_client.cc @@ -50,6 +50,10 @@ std::string ContentBrowserClient::GetApplicationLocale() { return std::string(); } +std::string ContentBrowserClient::GetAcceptLangs(const TabContents* tab) { + return std::string(); +} + bool ContentBrowserClient::AllowAppCache( const GURL& manifest_url, const content::ResourceContext& context) { return true; diff --git a/content/browser/content_browser_client.h b/content/browser/content_browser_client.h index 1e78d29..5cb2be8 100644 --- a/content/browser/content_browser_client.h +++ b/content/browser/content_browser_client.h @@ -73,6 +73,10 @@ class ContentBrowserClient { // Returns the locale used by the application. virtual std::string GetApplicationLocale(); + // Returns the languages used in the Accept-Languages HTTP header. + // (Not called GetAcceptLanguages so it doesn't clash with win32). + virtual std::string GetAcceptLangs(const TabContents* tab); + // Allow the embedder to control if an AppCache can be used for the given url. // This is called on the IO thread. virtual bool AllowAppCache(const GURL& manifest_url, diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index cf049ac..f5589b8a 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -15,17 +15,14 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/debugger/devtools_manager.h" -#include "chrome/browser/defaults.h" #include "chrome/browser/load_from_memory_cache_details.h" #include "chrome/browser/notifications/desktop_notification_service.h" #include "chrome/browser/notifications/desktop_notification_service_factory.h" -#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_host/web_cache_manager.h" #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/common/chrome_constants.h" -#include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "content/browser/child_process_security_policy.h" #include "content/browser/content_browser_client.h" @@ -331,9 +328,10 @@ const string16& TabContents::GetTitle() const { // Transient entries take precedence. They are used for interstitial pages // that are shown on top of existing pages. NavigationEntry* entry = controller_.GetTransientEntry(); + std::string accept_languages = + content::GetContentClient()->browser()->GetAcceptLangs(this); if (entry) { - return entry->GetTitleForDisplay(profile()->GetPrefs()-> - GetString(prefs::kAcceptLanguages)); + return entry->GetTitleForDisplay(accept_languages); } WebUI* our_web_ui = render_manager_.pending_web_ui() ? render_manager_.pending_web_ui() : render_manager_.web_ui(); @@ -354,8 +352,7 @@ const string16& TabContents::GetTitle() const { // title. entry = controller_.GetLastCommittedEntry(); if (entry) { - return entry->GetTitleForDisplay(profile()->GetPrefs()-> - GetString(prefs::kAcceptLanguages)); + return entry->GetTitleForDisplay(accept_languages); } return EmptyString16(); } @@ -670,13 +667,6 @@ bool TabContents::ShouldShowBookmarkBar() { if (showing_interstitial_page()) return false; - // Do not show bookmarks bar if bookmarks aren't enabled. - if (!browser_defaults::bookmarks_enabled) - return false; - - if (!profile()->GetPrefs()->GetBoolean(prefs::kEnableBookmarkBar)) - return false; - // See GetWebUIForCurrentState() comment for more info. This case is very // similar, but for non-first loads, we want to use the committed entry. This // is so the bookmarks bar disappears at the same time the page does. @@ -1728,7 +1718,7 @@ void TabContents::LoadStateChanged(const GURL& url, upload_position_ = upload_position; upload_size_ = upload_size; load_state_host_ = net::IDNToUnicode(url.host(), - profile()->GetPrefs()->GetString(prefs::kAcceptLanguages)); + content::GetContentClient()->browser()->GetAcceptLangs(this)); if (load_state_ == net::LOAD_STATE_READING_RESPONSE) SetNotWaitingForResponse(); if (is_loading()) diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index 67a2d50..2bead19 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -492,7 +492,6 @@ class TabContents : public PageNavigator, // the pending WebUI, the committed WebUI, or NULL. WebUI* GetWebUIForCurrentState(); - protected: friend class TabContentsObserver; friend class TabContentsObserver::Registrar; |