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

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

Issue 11410040: Delete WebUI for web intents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Return value from flag for profile disablement Created 8 years, 1 month 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
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 "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_list.h" 13 #include "chrome/browser/ui/browser_list.h"
14 #include "chrome/common/chrome_switches.h"
14 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
15 #include "chrome/common/url_constants.h" 16 #include "chrome/common/url_constants.h"
16 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
17 #include "net/base/mime_util.h" 18 #include "net/base/mime_util.h"
18 19
19 namespace web_intents { 20 namespace web_intents {
20 namespace { 21 namespace {
21 22
22 struct ActionMapping { 23 struct ActionMapping {
23 const char* name; 24 const char* name;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 "chrome-extension://gbkeegbaiigmenfmjfclcdgdpimamgkj/views/appViewer.html"; 57 "chrome-extension://gbkeegbaiigmenfmjfclcdgdpimamgkj/views/appViewer.html";
57 const char kQuickOfficeViewerDevServiceURL[] = 58 const char kQuickOfficeViewerDevServiceURL[] =
58 "chrome-extension://ionpfmkccalenbmnddpbmocokhaknphg/views/appEditor.html"; 59 "chrome-extension://ionpfmkccalenbmnddpbmocokhaknphg/views/appEditor.html";
59 60
60 void RegisterUserPrefs(PrefService* user_prefs) { 61 void RegisterUserPrefs(PrefService* user_prefs) {
61 user_prefs->RegisterBooleanPref(prefs::kWebIntentsEnabled, true, 62 user_prefs->RegisterBooleanPref(prefs::kWebIntentsEnabled, true,
62 PrefService::SYNCABLE_PREF); 63 PrefService::SYNCABLE_PREF);
63 } 64 }
64 65
65 bool IsWebIntentsEnabled(PrefService* prefs) { 66 bool IsWebIntentsEnabled(PrefService* prefs) {
66 return prefs->GetBoolean(prefs::kWebIntentsEnabled); 67 return CommandLine::ForCurrentProcess()->HasSwitch(
68 switches::kWebIntentsInvocationEnabled);
67 } 69 }
68 70
69 bool IsWebIntentsEnabledForProfile(Profile* profile) { 71 bool IsWebIntentsEnabledForProfile(Profile* profile) {
70 return IsWebIntentsEnabled(profile->GetPrefs()); 72 return IsWebIntentsEnabled(profile->GetPrefs());
71 } 73 }
72 74
73 Browser* GetBrowserForBackgroundWebIntentDelivery(Profile* profile) { 75 Browser* GetBrowserForBackgroundWebIntentDelivery(Profile* profile) {
74 Browser* browser = BrowserList::GetLastActive(); 76 Browser* browser = BrowserList::GetLastActive();
75 if (browser && profile && browser->profile() != profile) 77 if (browser && profile && browser->profile() != profile)
76 return NULL; 78 return NULL;
(...skipping 20 matching lines...) Expand all
97 // If either side is _all_ wildcard, it's a match! 99 // If either side is _all_ wildcard, it's a match!
98 if (t1 == "*" || t1 == "*/*" || t2 == "*" || t2 == "*/*") 100 if (t1 == "*" || t1 == "*/*" || t2 == "*" || t2 == "*/*")
99 return true; 101 return true;
100 102
101 StringToLowerASCII(&t1); 103 StringToLowerASCII(&t1);
102 StringToLowerASCII(&t2); 104 StringToLowerASCII(&t2);
103 return (net::MatchesMimeType(t1, t2)) || net::MatchesMimeType(t2, t1); 105 return (net::MatchesMimeType(t1, t2)) || net::MatchesMimeType(t2, t1);
104 } 106 }
105 107
106 } // namespace web_intents 108 } // namespace web_intents
OLDNEW
« no previous file with comments | « chrome/browser/intents/web_intents_registry.h ('k') | chrome/browser/resources/options/content_settings.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698