summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 18:31:20 +0000
committerrdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-18 18:31:20 +0000
commit597a867ba8f9b1d75b37093a7ab5cf68fed341c5 (patch)
tree185ed81bf0e5e6902ff47e71733f38490df3abc4
parenta63094c572533c8c9e19d36ea593552e2a4c2693 (diff)
downloadchromium_src-597a867ba8f9b1d75b37093a7ab5cf68fed341c5.zip
chromium_src-597a867ba8f9b1d75b37093a7ab5cf68fed341c5.tar.gz
chromium_src-597a867ba8f9b1d75b37093a7ab5cf68fed341c5.tar.bz2
Changed argument to GetAcceptLangs() to a BrowserContext.
Review URL: http://codereview.chromium.org/8475024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110719 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_content_browser_client.cc5
-rw-r--r--chrome/browser/chrome_content_browser_client.h3
-rw-r--r--content/browser/download/download_item.cc9
-rw-r--r--content/browser/download/save_package.cc3
-rw-r--r--content/browser/mock_content_browser_client.cc3
-rw-r--r--content/browser/mock_content_browser_client.h3
-rw-r--r--content/browser/tab_contents/tab_contents.cc9
-rw-r--r--content/public/browser/content_browser_client.h3
-rw-r--r--content/shell/shell_content_browser_client.cc3
-rw-r--r--content/shell/shell_content_browser_client.h3
10 files changed, 29 insertions, 15 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index a99c655..680655b 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -651,8 +651,9 @@ std::string ChromeContentBrowserClient::GetApplicationLocale() {
return g_browser_process->GetApplicationLocale();
}
-std::string ChromeContentBrowserClient::GetAcceptLangs(const TabContents* tab) {
- Profile* profile = Profile::FromBrowserContext(tab->browser_context());
+std::string ChromeContentBrowserClient::GetAcceptLangs(
+ content::BrowserContext* context) {
+ Profile* profile = Profile::FromBrowserContext(context);
return profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
}
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h
index 1f3883b..e174d4d 100644
--- a/chrome/browser/chrome_content_browser_client.h
+++ b/chrome/browser/chrome_content_browser_client.h
@@ -42,7 +42,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
virtual void AppendExtraCommandLineSwitches(CommandLine* command_line,
int child_process_id) OVERRIDE;
virtual std::string GetApplicationLocale() OVERRIDE;
- virtual std::string GetAcceptLangs(const TabContents* tab) OVERRIDE;
+ virtual std::string GetAcceptLangs(
+ content::BrowserContext* context) OVERRIDE;
virtual SkBitmap* GetDefaultFavicon() OVERRIDE;
virtual bool AllowAppCache(const GURL& manifest_url,
const GURL& first_party,
diff --git a/content/browser/download/download_item.cc b/content/browser/download/download_item.cc
index 799a2a2..3318a07 100644
--- a/content/browser/download/download_item.cc
+++ b/content/browser/download/download_item.cc
@@ -6,8 +6,8 @@
#include <vector>
-#include "base/bind.h"
#include "base/basictypes.h"
+#include "base/bind.h"
#include "base/file_util.h"
#include "base/format_macros.h"
#include "base/i18n/case_conversion.h"
@@ -25,6 +25,7 @@
#include "content/browser/download/download_request_handle.h"
#include "content/browser/download/download_stats.h"
#include "content/browser/download/interrupt_reasons.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/download_manager_delegate.h"
@@ -630,8 +631,10 @@ bool DownloadItem::MatchesQuery(const string16& query) const {
// "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD"
std::string languages;
TabContents* tab = GetTabContents();
- if (tab)
- languages = content::GetContentClient()->browser()->GetAcceptLangs(tab);
+ if (tab) {
+ languages = content::GetContentClient()->browser()->GetAcceptLangs(
+ tab->browser_context());
+ }
string16 url_formatted(net::FormatUrl(GetURL(), languages));
if (base::i18n::StringSearchIgnoringCaseAndAccents(query, url_formatted))
return true;
diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
index 9abb497..6be5513 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -1154,7 +1154,8 @@ void SavePackage::GetSaveInfo() {
tab_contents(), &website_save_dir, &download_save_dir);
std::string mime_type = tab_contents()->contents_mime_type();
std::string accept_languages =
- content::GetContentClient()->browser()->GetAcceptLangs(tab_contents());
+ content::GetContentClient()->browser()->GetAcceptLangs(
+ tab_contents()->browser_context());
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc
index 1898fd6..5b1c08b 100644
--- a/content/browser/mock_content_browser_client.cc
+++ b/content/browser/mock_content_browser_client.cc
@@ -102,7 +102,8 @@ std::string MockContentBrowserClient::GetApplicationLocale() {
return std::string();
}
-std::string MockContentBrowserClient::GetAcceptLangs(const TabContents* tab) {
+std::string MockContentBrowserClient::GetAcceptLangs(
+ content::BrowserContext* context) {
return std::string();
}
diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h
index 9f9d683..2b61f71 100644
--- a/content/browser/mock_content_browser_client.h
+++ b/content/browser/mock_content_browser_client.h
@@ -49,7 +49,8 @@ class MockContentBrowserClient : public ContentBrowserClient {
virtual void AppendExtraCommandLineSwitches(CommandLine* command_line,
int child_process_id) OVERRIDE;
virtual std::string GetApplicationLocale() OVERRIDE;
- virtual std::string GetAcceptLangs(const TabContents* tab) OVERRIDE;
+ virtual std::string GetAcceptLangs(
+ content::BrowserContext* context) OVERRIDE;
virtual SkBitmap* GetDefaultFavicon() OVERRIDE;
virtual bool AllowAppCache(const GURL& manifest_url,
const GURL& first_party,
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index d926eec..d9effbc 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -344,7 +344,8 @@ const string16& TabContents::GetTitle() const {
// that are shown on top of existing pages.
NavigationEntry* entry = controller_.GetTransientEntry();
std::string accept_languages =
- content::GetContentClient()->browser()->GetAcceptLangs(this);
+ content::GetContentClient()->browser()->GetAcceptLangs(
+ this->browser_context());
if (entry) {
return entry->GetTitleForDisplay(accept_languages);
}
@@ -1780,7 +1781,8 @@ void TabContents::RunJavaScriptMessage(
title_type = content::JavaScriptDialogCreator::DIALOG_TITLE_FORMATTED_URL;
title = net::FormatUrl(
frame_url.GetOrigin(),
- content::GetContentClient()->browser()->GetAcceptLangs(this));
+ content::GetContentClient()->browser()->GetAcceptLangs(
+ this->browser_context()));
}
dialog_creator_ = delegate_->GetJavaScriptDialogCreator();
@@ -1916,7 +1918,8 @@ void TabContents::LoadStateChanged(const GURL& url,
upload_position_ = upload_position;
upload_size_ = upload_size;
load_state_host_ = net::IDNToUnicode(url.host(),
- content::GetContentClient()->browser()->GetAcceptLangs(this));
+ content::GetContentClient()->browser()->GetAcceptLangs(
+ this->browser_context()));
if (load_state_.state == net::LOAD_STATE_READING_RESPONSE)
SetNotWaitingForResponse();
if (IsLoading())
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 216df17..7d5438e 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -165,7 +165,8 @@ class ContentBrowserClient {
// 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) = 0;
+ virtual std::string GetAcceptLangs(
+ content::BrowserContext* context) = 0;
// Returns the default favicon. The callee doesn't own the given bitmap.
virtual SkBitmap* GetDefaultFavicon() = 0;
diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc
index 805721a..394af26 100644
--- a/content/shell/shell_content_browser_client.cc
+++ b/content/shell/shell_content_browser_client.cc
@@ -115,7 +115,8 @@ std::string ShellContentBrowserClient::GetApplicationLocale() {
return std::string();
}
-std::string ShellContentBrowserClient::GetAcceptLangs(const TabContents* tab) {
+std::string ShellContentBrowserClient::GetAcceptLangs(
+ content::BrowserContext* context) {
return std::string();
}
diff --git a/content/shell/shell_content_browser_client.h b/content/shell/shell_content_browser_client.h
index c5e2794..4d0ac37 100644
--- a/content/shell/shell_content_browser_client.h
+++ b/content/shell/shell_content_browser_client.h
@@ -62,7 +62,8 @@ class ShellContentBrowserClient : public ContentBrowserClient
virtual void AppendExtraCommandLineSwitches(CommandLine* command_line,
int child_process_id) OVERRIDE;
virtual std::string GetApplicationLocale() OVERRIDE;
- virtual std::string GetAcceptLangs(const TabContents* tab) OVERRIDE;
+ virtual std::string GetAcceptLangs(
+ content::BrowserContext* context) OVERRIDE;
virtual SkBitmap* GetDefaultFavicon() OVERRIDE;
virtual bool AllowAppCache(const GURL& manifest_url,
const GURL& first_party,