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 "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 DCHECK(rules[0].secondary_pattern == ContentSettingsPattern::Wildcard()); | 54 DCHECK(rules[0].secondary_pattern == ContentSettingsPattern::Wildcard()); |
55 return rules[0].setting; | 55 return rules[0].setting; |
56 } | 56 } |
57 const GURL& primary_url = GetOriginOrURL(frame); | 57 const GURL& primary_url = GetOriginOrURL(frame); |
58 for (it = rules.begin(); it != rules.end(); ++it) { | 58 for (it = rules.begin(); it != rules.end(); ++it) { |
59 if (it->primary_pattern.Matches(primary_url) && | 59 if (it->primary_pattern.Matches(primary_url) && |
60 it->secondary_pattern.Matches(secondary_url)) { | 60 it->secondary_pattern.Matches(secondary_url)) { |
61 return it->setting; | 61 return it->setting; |
62 } | 62 } |
63 } | 63 } |
64 NOTREACHED(); | |
Charlie Reis
2013/11/27 17:35:55
Why is this changing?
| |
65 return CONTENT_SETTING_DEFAULT; | 64 return CONTENT_SETTING_DEFAULT; |
jochen (gone - plz use gerrit)
2013/11/28 22:23:30
DEFAULT is just a placeholder value, we should nev
| |
66 } | 65 } |
67 | 66 |
68 } // namespace | 67 } // namespace |
69 | 68 |
70 ContentSettingsObserver::ContentSettingsObserver( | 69 ContentSettingsObserver::ContentSettingsObserver( |
71 content::RenderView* render_view) | 70 content::RenderView* render_view) |
72 : content::RenderViewObserver(render_view), | 71 : content::RenderViewObserver(render_view), |
73 content::RenderViewObserverTracker<ContentSettingsObserver>(render_view), | 72 content::RenderViewObserverTracker<ContentSettingsObserver>(render_view), |
74 content_setting_rules_(NULL), | 73 content_setting_rules_(NULL), |
75 is_interstitial_page_(false), | 74 is_interstitial_page_(false), |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
367 | 366 |
368 // If the scheme is file:, an empty file name indicates a directory listing, | 367 // If the scheme is file:, an empty file name indicates a directory listing, |
369 // which requires JavaScript to function properly. | 368 // which requires JavaScript to function properly. |
370 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) { | 369 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) { |
371 return document_url.SchemeIs(chrome::kFileScheme) && | 370 return document_url.SchemeIs(chrome::kFileScheme) && |
372 document_url.ExtractFileName().empty(); | 371 document_url.ExtractFileName().empty(); |
373 } | 372 } |
374 | 373 |
375 return false; | 374 return false; |
376 } | 375 } |
OLD | NEW |