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.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 bool IsWebIntentsEnabled(PrefService* prefs) { | 23 bool IsWebIntentsEnabled(PrefService* prefs) { |
24 return prefs->GetBoolean(prefs::kWebIntentsEnabled); | 24 return prefs->GetBoolean(prefs::kWebIntentsEnabled); |
25 } | 25 } |
26 | 26 |
27 bool IsWebIntentsEnabledForProfile(Profile* profile) { | 27 bool IsWebIntentsEnabledForProfile(Profile* profile) { |
28 return IsWebIntentsEnabled(profile->GetPrefs()); | 28 return IsWebIntentsEnabled(profile->GetPrefs()); |
29 } | 29 } |
30 | 30 |
| 31 Browser* GetWebIntentDeliveryBrowser(Profile* profile) { |
| 32 Browser* browser = BrowserList::GetLastActive(); |
| 33 if (browser && profile && browser->profile() != profile) |
| 34 return NULL; |
| 35 return browser; |
| 36 } |
| 37 |
31 } // namespace web_intents | 38 } // namespace web_intents |
OLD | NEW |