| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/intents/web_intents_util.h" | 5 #include "chrome/browser/intents/web_intents_util.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
| 11 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 12 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
| 13 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 14 | 15 |
| 15 namespace web_intents { | 16 namespace web_intents { |
| 16 | 17 |
| 17 void RegisterUserPrefs(PrefService* user_prefs) { | 18 void RegisterUserPrefs(PrefService* user_prefs) { |
| 18 user_prefs->RegisterBooleanPref(prefs::kWebIntentsEnabled, true, | 19 user_prefs->RegisterBooleanPref(prefs::kWebIntentsEnabled, true, |
| 19 PrefService::SYNCABLE_PREF); | 20 PrefService::SYNCABLE_PREF); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 bool IsWebIntentsEnabledInActiveBrowser() { | 33 bool IsWebIntentsEnabledInActiveBrowser() { |
| 33 Browser* browser = BrowserList::GetLastActive(); | 34 Browser* browser = BrowserList::GetLastActive(); |
| 34 if (!browser) | 35 if (!browser) |
| 35 browser = *BrowserList::begin(); | 36 browser = *BrowserList::begin(); |
| 36 DCHECK(browser); | 37 DCHECK(browser); |
| 37 | 38 |
| 38 return IsWebIntentsEnabled(browser->profile()); | 39 return IsWebIntentsEnabled(browser->profile()); |
| 39 } | 40 } |
| 40 | 41 |
| 41 } // namespace web_intents | 42 } // namespace web_intents |
| OLD | NEW |