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

Side by Side Diff: chrome/browser/geolocation/geolocation_content_settings_map.cc

Issue 3163015: Remove deprecated wstring DictionaryValue::Get{Dictionary,List}WithoutPathExpansion() overloads. (Closed)
Patch Set: Created 10 years, 4 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/browser/background_contents_service_unittest.cc ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // Implementation of the geolocation content settings map. Styled on 5 // Implementation of the geolocation content settings map. Styled on
6 // HostContentSettingsMap however unlike that class, this one does not hold 6 // HostContentSettingsMap however unlike that class, this one does not hold
7 // an additional in-memory copy of the settings as it does not need to support 7 // an additional in-memory copy of the settings as it does not need to support
8 // thread safe synchronous access to the settings; all geolocation permissions 8 // thread safe synchronous access to the settings; all geolocation permissions
9 // are read and written in the UI thread. (If in future this is no longer the 9 // are read and written in the UI thread. (If in future this is no longer the
10 // case, refer to http://codereview.chromium.org/1525018 for a previous version 10 // case, refer to http://codereview.chromium.org/1525018 for a previous version
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 GURL requesting_origin(requesting_url.GetOrigin()); 60 GURL requesting_origin(requesting_url.GetOrigin());
61 GURL embedding_origin(embedding_url.GetOrigin()); 61 GURL embedding_origin(embedding_url.GetOrigin());
62 DCHECK(requesting_origin.is_valid() && embedding_origin.is_valid()); 62 DCHECK(requesting_origin.is_valid() && embedding_origin.is_valid());
63 63
64 const DictionaryValue* all_settings_dictionary = 64 const DictionaryValue* all_settings_dictionary =
65 profile_->GetPrefs()->GetDictionary(prefs::kGeolocationContentSettings); 65 profile_->GetPrefs()->GetDictionary(prefs::kGeolocationContentSettings);
66 // Careful: The returned value could be NULL if the pref has never been set. 66 // Careful: The returned value could be NULL if the pref has never been set.
67 if (all_settings_dictionary != NULL) { 67 if (all_settings_dictionary != NULL) {
68 DictionaryValue* requesting_origin_settings; 68 DictionaryValue* requesting_origin_settings;
69 if (all_settings_dictionary->GetDictionaryWithoutPathExpansion( 69 if (all_settings_dictionary->GetDictionaryWithoutPathExpansion(
70 UTF8ToWide(requesting_origin.spec()), &requesting_origin_settings)) { 70 requesting_origin.spec(), &requesting_origin_settings)) {
71 int setting; 71 int setting;
72 if (requesting_origin_settings->GetIntegerWithoutPathExpansion( 72 if (requesting_origin_settings->GetIntegerWithoutPathExpansion(
73 UTF8ToWide(embedding_origin.spec()), &setting)) 73 UTF8ToWide(embedding_origin.spec()), &setting))
74 return IntToContentSetting(setting); 74 return IntToContentSetting(setting);
75 // Check for any-embedder setting 75 // Check for any-embedder setting
76 if (requesting_origin != embedding_origin && 76 if (requesting_origin != embedding_origin &&
77 requesting_origin_settings->GetIntegerWithoutPathExpansion( 77 requesting_origin_settings->GetIntegerWithoutPathExpansion(
78 L"", &setting)) 78 "", &setting))
79 return IntToContentSetting(setting); 79 return IntToContentSetting(setting);
80 } 80 }
81 } 81 }
82 return GetDefaultContentSetting(); 82 return GetDefaultContentSetting();
83 } 83 }
84 84
85 GeolocationContentSettingsMap::AllOriginsSettings 85 GeolocationContentSettingsMap::AllOriginsSettings
86 GeolocationContentSettingsMap::GetAllOriginsSettings() const { 86 GeolocationContentSettingsMap::GetAllOriginsSettings() const {
87 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); 87 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
88 AllOriginsSettings content_settings; 88 AllOriginsSettings content_settings;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 bool found = dictionary->GetIntegerWithoutPathExpansion(target, &setting); 180 bool found = dictionary->GetIntegerWithoutPathExpansion(target, &setting);
181 DCHECK(found); 181 DCHECK(found);
182 GURL target_url(target); 182 GURL target_url(target);
183 // An empty URL has a special meaning (wildcard), so only accept invalid 183 // An empty URL has a special meaning (wildcard), so only accept invalid
184 // URLs if the original version was empty (avoids treating corrupted prefs 184 // URLs if the original version was empty (avoids treating corrupted prefs
185 // as the wildcard entry; see http://crbug.com/39685) 185 // as the wildcard entry; see http://crbug.com/39685)
186 if (target_url.is_valid() || target.empty()) 186 if (target_url.is_valid() || target.empty())
187 (*one_origin_settings)[target_url] = IntToContentSetting(setting); 187 (*one_origin_settings)[target_url] = IntToContentSetting(setting);
188 } 188 }
189 } 189 }
OLDNEW
« no previous file with comments | « chrome/browser/background_contents_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698