| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // correctly detect that a piece of content flipped from "not blocked" to | 236 // correctly detect that a piece of content flipped from "not blocked" to |
| 237 // "blocked". | 237 // "blocked". |
| 238 ClearBlockedContentSettings(); | 238 ClearBlockedContentSettings(); |
| 239 temporarily_allowed_plugins_.clear(); | 239 temporarily_allowed_plugins_.clear(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 GURL url = frame->document().url(); | 242 GURL url = frame->document().url(); |
| 243 // If we start failing this DCHECK, please makes sure we don't regress | 243 // If we start failing this DCHECK, please makes sure we don't regress |
| 244 // this bug: http://code.google.com/p/chromium/issues/detail?id=79304 | 244 // this bug: http://code.google.com/p/chromium/issues/detail?id=79304 |
| 245 DCHECK(frame->document().securityOrigin().toString() == "null" || | 245 DCHECK(frame->document().securityOrigin().toString() == "null" || |
| 246 !url.SchemeIs(content::kDataScheme)); | 246 !url.SchemeIs(url::kDataScheme)); |
| 247 } | 247 } |
| 248 | 248 |
| 249 bool ContentSettingsObserver::allowDatabase(const WebString& name, | 249 bool ContentSettingsObserver::allowDatabase(const WebString& name, |
| 250 const WebString& display_name, | 250 const WebString& display_name, |
| 251 unsigned long estimated_size) { | 251 unsigned long estimated_size) { |
| 252 WebFrame* frame = render_frame()->GetWebFrame(); | 252 WebFrame* frame = render_frame()->GetWebFrame(); |
| 253 if (frame->document().securityOrigin().isUnique() || | 253 if (frame->document().securityOrigin().isUnique() || |
| 254 frame->top()->document().securityOrigin().isUnique()) | 254 frame->top()->document().securityOrigin().isUnique()) |
| 255 return false; | 255 return false; |
| 256 | 256 |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) | 658 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) |
| 659 return true; | 659 return true; |
| 660 | 660 |
| 661 // TODO(creis, fsamuel): Remove this once the concept of swapped out | 661 // TODO(creis, fsamuel): Remove this once the concept of swapped out |
| 662 // RenderFrames goes away. | 662 // RenderFrames goes away. |
| 663 if (document_url == GURL(content::kSwappedOutURL)) | 663 if (document_url == GURL(content::kSwappedOutURL)) |
| 664 return true; | 664 return true; |
| 665 | 665 |
| 666 // If the scheme is file:, an empty file name indicates a directory listing, | 666 // If the scheme is file:, an empty file name indicates a directory listing, |
| 667 // which requires JavaScript to function properly. | 667 // which requires JavaScript to function properly. |
| 668 if (EqualsASCII(origin.protocol(), content::kFileScheme)) { | 668 if (EqualsASCII(origin.protocol(), url::kFileScheme)) { |
| 669 return document_url.SchemeIs(content::kFileScheme) && | 669 return document_url.SchemeIs(url::kFileScheme) && |
| 670 document_url.ExtractFileName().empty(); | 670 document_url.ExtractFileName().empty(); |
| 671 } | 671 } |
| 672 | 672 |
| 673 return false; | 673 return false; |
| 674 } | 674 } |
| OLD | NEW |