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

Side by Side Diff: components/content_settings/core/browser/host_content_settings_map.cc

Issue 1099453005: Switch web API/permission code to use IsOriginSecure() instead of SchemeIsSecure(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nhiroki's comment. Created 5 years, 8 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 // 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 "components/content_settings/core/browser/host_content_settings_map.h" 5 #include "components/content_settings/core/browser/host_content_settings_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "base/time/clock.h" 15 #include "base/time/clock.h"
16 #include "chrome/common/origin_util.h"
16 #include "components/content_settings/core/browser/content_settings_default_prov ider.h" 17 #include "components/content_settings/core/browser/content_settings_default_prov ider.h"
17 #include "components/content_settings/core/browser/content_settings_details.h" 18 #include "components/content_settings/core/browser/content_settings_details.h"
18 #include "components/content_settings/core/browser/content_settings_observable_p rovider.h" 19 #include "components/content_settings/core/browser/content_settings_observable_p rovider.h"
19 #include "components/content_settings/core/browser/content_settings_policy_provi der.h" 20 #include "components/content_settings/core/browser/content_settings_policy_provi der.h"
20 #include "components/content_settings/core/browser/content_settings_pref_provide r.h" 21 #include "components/content_settings/core/browser/content_settings_pref_provide r.h"
21 #include "components/content_settings/core/browser/content_settings_provider.h" 22 #include "components/content_settings/core/browser/content_settings_provider.h"
22 #include "components/content_settings/core/browser/content_settings_rule.h" 23 #include "components/content_settings/core/browser/content_settings_rule.h"
23 #include "components/content_settings/core/browser/content_settings_utils.h" 24 #include "components/content_settings/core/browser/content_settings_utils.h"
24 #include "components/content_settings/core/common/content_settings_pattern.h" 25 #include "components/content_settings/core/common/content_settings_pattern.h"
25 #include "components/content_settings/core/common/pref_names.h" 26 #include "components/content_settings/core/common/pref_names.h"
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 content_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { 648 content_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) {
648 return false; 649 return false;
649 } 650 }
650 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) 651 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
651 if (content_type == CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER) { 652 if (content_type == CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER) {
652 return false; 653 return false;
653 } 654 }
654 #endif 655 #endif
655 if (secondary_url.SchemeIs(kChromeUIScheme) && 656 if (secondary_url.SchemeIs(kChromeUIScheme) &&
656 content_type == CONTENT_SETTINGS_TYPE_COOKIES && 657 content_type == CONTENT_SETTINGS_TYPE_COOKIES &&
657 primary_url.SchemeIsSecure()) { 658 IsOriginSecure(primary_url)) {
658 return true; 659 return true;
659 } 660 }
660 #if defined(ENABLE_EXTENSIONS) 661 #if defined(ENABLE_EXTENSIONS)
661 if (primary_url.SchemeIs(kExtensionScheme)) { 662 if (primary_url.SchemeIs(kExtensionScheme)) {
662 switch (content_type) { 663 switch (content_type) {
663 case CONTENT_SETTINGS_TYPE_PLUGINS: 664 case CONTENT_SETTINGS_TYPE_PLUGINS:
664 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: 665 case CONTENT_SETTINGS_TYPE_MEDIASTREAM:
665 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: 666 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC:
666 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: 667 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA:
667 return false; 668 return false;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 } 765 }
765 } 766 }
766 767
767 if (info) { 768 if (info) {
768 info->source = content_settings::SETTING_SOURCE_NONE; 769 info->source = content_settings::SETTING_SOURCE_NONE;
769 info->primary_pattern = ContentSettingsPattern(); 770 info->primary_pattern = ContentSettingsPattern();
770 info->secondary_pattern = ContentSettingsPattern(); 771 info->secondary_pattern = ContentSettingsPattern();
771 } 772 }
772 return scoped_ptr<base::Value>(); 773 return scoped_ptr<base::Value>();
773 } 774 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698