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

Side by Side Diff: chrome/renderer/content_settings_observer.cc

Issue 273193004: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing files. Created 6 years, 6 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
« no previous file with comments | « chrome/common/net/url_util.cc ('k') | chrome/renderer/extensions/chrome_extension_helper.cc » ('j') | 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/renderer/content_settings_observer.h" 5 #include "chrome/renderer/content_settings_observer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // correctly detect that a piece of content flipped from "not blocked" to 240 // correctly detect that a piece of content flipped from "not blocked" to
241 // "blocked". 241 // "blocked".
242 ClearBlockedContentSettings(); 242 ClearBlockedContentSettings();
243 temporarily_allowed_plugins_.clear(); 243 temporarily_allowed_plugins_.clear();
244 } 244 }
245 245
246 GURL url = frame->document().url(); 246 GURL url = frame->document().url();
247 // If we start failing this DCHECK, please makes sure we don't regress 247 // If we start failing this DCHECK, please makes sure we don't regress
248 // this bug: http://code.google.com/p/chromium/issues/detail?id=79304 248 // this bug: http://code.google.com/p/chromium/issues/detail?id=79304
249 DCHECK(frame->document().securityOrigin().toString() == "null" || 249 DCHECK(frame->document().securityOrigin().toString() == "null" ||
250 !url.SchemeIs(content::kDataScheme)); 250 !url.SchemeIs(url::kDataScheme));
251 } 251 }
252 252
253 bool ContentSettingsObserver::allowDatabase(const WebString& name, 253 bool ContentSettingsObserver::allowDatabase(const WebString& name,
254 const WebString& display_name, 254 const WebString& display_name,
255 unsigned long estimated_size) { 255 unsigned long estimated_size) {
256 WebFrame* frame = render_frame()->GetWebFrame(); 256 WebFrame* frame = render_frame()->GetWebFrame();
257 if (frame->document().securityOrigin().isUnique() || 257 if (frame->document().securityOrigin().isUnique() ||
258 frame->top()->document().securityOrigin().isUnique()) 258 frame->top()->document().securityOrigin().isUnique())
259 return false; 259 return false;
260 260
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) 690 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme))
691 return true; 691 return true;
692 692
693 // TODO(creis, fsamuel): Remove this once the concept of swapped out 693 // TODO(creis, fsamuel): Remove this once the concept of swapped out
694 // RenderFrames goes away. 694 // RenderFrames goes away.
695 if (document_url == GURL(content::kSwappedOutURL)) 695 if (document_url == GURL(content::kSwappedOutURL))
696 return true; 696 return true;
697 697
698 // If the scheme is file:, an empty file name indicates a directory listing, 698 // If the scheme is file:, an empty file name indicates a directory listing,
699 // which requires JavaScript to function properly. 699 // which requires JavaScript to function properly.
700 if (EqualsASCII(origin.protocol(), content::kFileScheme)) { 700 if (EqualsASCII(origin.protocol(), url::kFileScheme)) {
701 return document_url.SchemeIs(content::kFileScheme) && 701 return document_url.SchemeIs(url::kFileScheme) &&
702 document_url.ExtractFileName().empty(); 702 document_url.ExtractFileName().empty();
703 } 703 }
704 704
705 return false; 705 return false;
706 } 706 }
OLDNEW
« no previous file with comments | « chrome/common/net/url_util.cc ('k') | chrome/renderer/extensions/chrome_extension_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698