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

Side by Side Diff: chrome/browser/intents/web_intents_util.cc

Issue 10880074: Don't prompt for directory on web intents downloads; handle in current tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More android ifdef Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698