Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Unified Diff: chrome/browser/intents/web_intents_util.cc

Issue 10134026: Remove browser from web intents UI code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Browser test compilation Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/intents/web_intents_util.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/intents/web_intents_util.cc
diff --git a/chrome/browser/intents/web_intents_util.cc b/chrome/browser/intents/web_intents_util.cc
index 7141d303e5a8462274ee4b954b396b3a73c476f6..7261f5ae4705ad6f5ebffafaaa0ca84826a07ae4 100644
--- a/chrome/browser/intents/web_intents_util.cc
+++ b/chrome/browser/intents/web_intents_util.cc
@@ -19,19 +19,24 @@ void RegisterUserPrefs(PrefService* user_prefs) {
PrefService::SYNCABLE_PREF);
}
-bool IsWebIntentsEnabled() {
+bool IsWebIntentsEnabled(Profile* profile) {
bool disabled_flag = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableWebIntents);
+ bool enabled_pref = profile->GetPrefs()->GetBoolean(
+ prefs::kWebIntentsEnabled);
+
+ return !disabled_flag && enabled_pref;
+}
+
+bool IsWebIntentsEnabledInActiveBrowser() {
Browser* browser = BrowserList::GetLastActive();
if (!browser)
browser = *BrowserList::begin();
+ DCHECK(browser);
Profile* profile = browser->GetProfile();
- bool enabled_pref = profile->GetPrefs()->GetBoolean(
- prefs::kWebIntentsEnabled);
-
- return !disabled_flag && enabled_pref;
+ return IsWebIntentsEnabled(profile);
}
} // namespace web_intents
« no previous file with comments | « chrome/browser/intents/web_intents_util.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698