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

Side by Side Diff: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp

Issue 22859043: Add a CustomSchemeHandler runtime flag to remove ENABLE(CUSTOM_SCHEME_HANDLER) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, Google Inc. All rights reserved.
3 * Copyright (C) 2012, Samsung Electronics. All rights reserved. 3 * Copyright (C) 2012, Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 if (!verifyCustomHandlerURL(baseURL, url, exceptionState)) 148 if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
149 return; 149 return;
150 150
151 if (!verifyProtocolHandlerScheme(scheme, "registerProtocolHandler", exceptio nState)) 151 if (!verifyProtocolHandlerScheme(scheme, "registerProtocolHandler", exceptio nState))
152 return; 152 return;
153 153
154 NavigatorContentUtils::from(navigator->frame()->page())->client()->registerP rotocolHandler(scheme, baseURL, url, title); 154 NavigatorContentUtils::from(navigator->frame()->page())->client()->registerP rotocolHandler(scheme, baseURL, url, title);
155 } 155 }
156 156
157 #if ENABLE(CUSTOM_SCHEME_HANDLER)
158 static String customHandlersStateString(const NavigatorContentUtilsClient::Custo mHandlersState state) 157 static String customHandlersStateString(const NavigatorContentUtilsClient::Custo mHandlersState state)
159 { 158 {
160 DEFINE_STATIC_LOCAL(const String, newHandler, ("new")); 159 DEFINE_STATIC_LOCAL(const String, newHandler, ("new"));
161 DEFINE_STATIC_LOCAL(const String, registeredHandler, ("registered")); 160 DEFINE_STATIC_LOCAL(const String, registeredHandler, ("registered"));
162 DEFINE_STATIC_LOCAL(const String, declinedHandler, ("declined")); 161 DEFINE_STATIC_LOCAL(const String, declinedHandler, ("declined"));
163 162
164 switch (state) { 163 switch (state) {
165 case NavigatorContentUtilsClient::CustomHandlersNew: 164 case NavigatorContentUtilsClient::CustomHandlersNew:
166 return newHandler; 165 return newHandler;
167 case NavigatorContentUtilsClient::CustomHandlersRegistered: 166 case NavigatorContentUtilsClient::CustomHandlersRegistered:
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 String baseURL = document->baseURL().baseAsString(); 201 String baseURL = document->baseURL().baseAsString();
203 202
204 if (!verifyCustomHandlerURL(baseURL, url, exceptionState)) 203 if (!verifyCustomHandlerURL(baseURL, url, exceptionState))
205 return; 204 return;
206 205
207 if (!verifyProtocolHandlerScheme(scheme, "unregisterProtocolHandler", except ionState)) 206 if (!verifyProtocolHandlerScheme(scheme, "unregisterProtocolHandler", except ionState))
208 return; 207 return;
209 208
210 NavigatorContentUtils::from(navigator->frame()->page())->client()->unregiste rProtocolHandler(scheme, baseURL, url); 209 NavigatorContentUtils::from(navigator->frame()->page())->client()->unregiste rProtocolHandler(scheme, baseURL, url);
211 } 210 }
212 #endif
213 211
214 const char* NavigatorContentUtils::supplementName() 212 const char* NavigatorContentUtils::supplementName()
215 { 213 {
216 return "NavigatorContentUtils"; 214 return "NavigatorContentUtils";
217 } 215 }
218 216
219 void provideNavigatorContentUtilsTo(Page* page, NavigatorContentUtilsClient* cli ent) 217 void provideNavigatorContentUtilsTo(Page* page, NavigatorContentUtilsClient* cli ent)
220 { 218 {
221 RefCountedSupplement<Page, NavigatorContentUtils>::provideTo(page, Navigator ContentUtils::supplementName(), NavigatorContentUtils::create(client)); 219 RefCountedSupplement<Page, NavigatorContentUtils>::provideTo(page, Navigator ContentUtils::supplementName(), NavigatorContentUtils::create(client));
222 } 220 }
223 221
224 } // namespace WebCore 222 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698