summaryrefslogtreecommitdiffstats
path: root/chrome/browser/intents
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 03:24:46 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 03:24:46 +0000
commitd94361506fc6d10a85e1de864a9769ac1924c5ed (patch)
treeaf482152b0fa33d81b953f849ed851c44a3f36dd /chrome/browser/intents
parent089304c67b89e55554d12469136b159a2d9c76f9 (diff)
downloadchromium_src-d94361506fc6d10a85e1de864a9769ac1924c5ed.zip
chromium_src-d94361506fc6d10a85e1de864a9769ac1924c5ed.tar.gz
chromium_src-d94361506fc6d10a85e1de864a9769ac1924c5ed.tar.bz2
Remove IsWebIntentsEnabledForActiveBrowser and change HostContentSettingsMap to use a variant that supplies a PrefService instead.
http://crbug.com/129187 TEST=none Review URL: https://chromiumcodereview.appspot.com/10432005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138721 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/intents')
-rw-r--r--chrome/browser/intents/register_intent_handler_helper.cc2
-rw-r--r--chrome/browser/intents/web_intents_util.cc13
-rw-r--r--chrome/browser/intents/web_intents_util.h9
3 files changed, 9 insertions, 15 deletions
diff --git a/chrome/browser/intents/register_intent_handler_helper.cc b/chrome/browser/intents/register_intent_handler_helper.cc
index 371b670..abfd47f 100644
--- a/chrome/browser/intents/register_intent_handler_helper.cc
+++ b/chrome/browser/intents/register_intent_handler_helper.cc
@@ -28,7 +28,7 @@ void Browser::RegisterIntentHandlerHelper(WebContents* tab,
if (!tcw || tcw->profile()->IsOffTheRecord())
return;
- if (!web_intents::IsWebIntentsEnabled(tcw->profile()))
+ if (!web_intents::IsWebIntentsEnabledForProfile(tcw->profile()))
return;
FaviconService* favicon_service =
diff --git a/chrome/browser/intents/web_intents_util.cc b/chrome/browser/intents/web_intents_util.cc
index 848d11a..319335b 100644
--- a/chrome/browser/intents/web_intents_util.cc
+++ b/chrome/browser/intents/web_intents_util.cc
@@ -20,17 +20,12 @@ void RegisterUserPrefs(PrefService* user_prefs) {
PrefService::SYNCABLE_PREF);
}
-bool IsWebIntentsEnabled(Profile* profile) {
- return profile->GetPrefs()->GetBoolean(prefs::kWebIntentsEnabled);
+bool IsWebIntentsEnabled(PrefService* prefs) {
+ return prefs->GetBoolean(prefs::kWebIntentsEnabled);
}
-bool IsWebIntentsEnabledInActiveBrowser() {
- Browser* browser = BrowserList::GetLastActive();
- if (!browser)
- browser = *BrowserList::begin();
- DCHECK(browser);
-
- return IsWebIntentsEnabled(browser->profile());
+bool IsWebIntentsEnabledForProfile(Profile* profile) {
+ return IsWebIntentsEnabled(profile->GetPrefs());
}
} // namespace web_intents
diff --git a/chrome/browser/intents/web_intents_util.h b/chrome/browser/intents/web_intents_util.h
index cd47ca2..31ac731 100644
--- a/chrome/browser/intents/web_intents_util.h
+++ b/chrome/browser/intents/web_intents_util.h
@@ -14,13 +14,12 @@ namespace web_intents {
// Registers the preferences related to Web Intents.
void RegisterUserPrefs(PrefService* user_prefs);
+// Returns true if WebIntents are enabled in preferences.
+bool IsWebIntentsEnabled(PrefService* prefs);
+
// Returns true if WebIntents are enabled due to various factors. |profile| is
// the Profile to check that WebIntents are enabled for.
-bool IsWebIntentsEnabled(Profile* profile);
-
-// Returns true if WebIntents are enabled due to various factors. Check using
-// the profile of the currently active Browser.
-bool IsWebIntentsEnabledInActiveBrowser();
+bool IsWebIntentsEnabledForProfile(Profile* profile);
} // namespace web_intents