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 "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 bool IsWebIntentsEnabled(PrefService* prefs) { | 51 bool IsWebIntentsEnabled(PrefService* prefs) { |
52 return prefs->GetBoolean(prefs::kWebIntentsEnabled); | 52 return prefs->GetBoolean(prefs::kWebIntentsEnabled); |
53 } | 53 } |
54 | 54 |
55 bool IsWebIntentsEnabledForProfile(Profile* profile) { | 55 bool IsWebIntentsEnabledForProfile(Profile* profile) { |
56 return IsWebIntentsEnabled(profile->GetPrefs()); | 56 return IsWebIntentsEnabled(profile->GetPrefs()); |
57 } | 57 } |
58 | 58 |
59 Browser* GetBrowserForBackgroundWebIntentDelivery(Profile* profile) { | 59 Browser* GetBrowserForBackgroundWebIntentDelivery(Profile* profile) { |
| 60 #if defined(OS_ANDROID) |
| 61 return NULL; |
| 62 #else |
60 Browser* browser = BrowserList::GetLastActive(); | 63 Browser* browser = BrowserList::GetLastActive(); |
61 if (browser && profile && browser->profile() != profile) | 64 if (browser && profile && browser->profile() != profile) |
62 return NULL; | 65 return NULL; |
63 return browser; | 66 return browser; |
| 67 #endif // defined(OS_ANDROID) |
64 } | 68 } |
65 | 69 |
66 bool IsRecognizedAction(const string16& action) { | 70 bool IsRecognizedAction(const string16& action) { |
67 const ActionMapping* mapping = FindActionMapping(action); | 71 const ActionMapping* mapping = FindActionMapping(action); |
68 return mapping != NULL; | 72 return mapping != NULL; |
69 } | 73 } |
70 | 74 |
71 ActionId ToActionId(const string16& action) { | 75 ActionId ToActionId(const string16& action) { |
72 const ActionMapping* mapping = FindActionMapping(action); | 76 const ActionMapping* mapping = FindActionMapping(action); |
73 return mapping != NULL ? mapping->id : ACTION_ID_CUSTOM; | 77 return mapping != NULL ? mapping->id : ACTION_ID_CUSTOM; |
74 } | 78 } |
75 | 79 |
76 } // namespace web_intents | 80 } // namespace web_intents |
OLD | NEW |