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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |