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

Side by Side Diff: chrome/browser/notifications/platform_notification_service_impl.cc

Issue 1034143002: Content settings clean-up: Clarify resource identifier & get rid of NO_RESOURCE_IDENTIFIER. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nit. 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/notifications/platform_notification_service_impl.h" 5 #include "chrome/browser/notifications/platform_notification_service_impl.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/notifications/desktop_notification_profile_util.h" 10 #include "chrome/browser/notifications/desktop_notification_profile_util.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 #endif 173 #endif
174 174
175 // No enabled extensions exist, so check the normal host content settings. 175 // No enabled extensions exist, so check the normal host content settings.
176 HostContentSettingsMap* host_content_settings_map = 176 HostContentSettingsMap* host_content_settings_map =
177 io_data->GetHostContentSettingsMap(); 177 io_data->GetHostContentSettingsMap();
178 ContentSetting setting = host_content_settings_map->GetContentSetting( 178 ContentSetting setting = host_content_settings_map->GetContentSetting(
179 origin, 179 origin,
180 origin, 180 origin,
181 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, 181 CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
182 NO_RESOURCE_IDENTIFIER); 182 content_settings::ResourceIdentifier());
183 183
184 if (setting == CONTENT_SETTING_ALLOW) 184 if (setting == CONTENT_SETTING_ALLOW)
185 return blink::WebNotificationPermissionAllowed; 185 return blink::WebNotificationPermissionAllowed;
186 if (setting == CONTENT_SETTING_BLOCK) 186 if (setting == CONTENT_SETTING_BLOCK)
187 return blink::WebNotificationPermissionDenied; 187 return blink::WebNotificationPermissionDenied;
188 188
189 return blink::WebNotificationPermissionDefault; 189 return blink::WebNotificationPermissionDefault;
190 } 190 }
191 191
192 void PlatformNotificationServiceImpl::DisplayNotification( 192 void PlatformNotificationServiceImpl::DisplayNotification(
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 formatted_origin.push_back(':'); 332 formatted_origin.push_back(':');
333 formatted_origin.append(base::UTF8ToUTF16(origin.port())); 333 formatted_origin.append(base::UTF8ToUTF16(origin.port()));
334 } 334 }
335 return formatted_origin; 335 return formatted_origin;
336 } 336 }
337 337
338 // TODO(dewittj): Once file:// URLs are passed in to the origin 338 // TODO(dewittj): Once file:// URLs are passed in to the origin
339 // GURL here, begin returning the path as the display name. 339 // GURL here, begin returning the path as the display name.
340 return net::FormatUrl(origin, languages); 340 return net::FormatUrl(origin, languages);
341 } 341 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698