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

Side by Side Diff: chrome/browser/services/gcm/push_messaging_service_impl.cc

Issue 661643002: Adds a context message of the security origin for web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 5 years, 10 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/services/gcm/push_messaging_service_impl.h" 5 #include "chrome/browser/services/gcm/push_messaging_service_impl.h"
6 6
7 #include <bitset> 7 #include <bitset>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 notification_data.tag = 389 notification_data.tag =
390 base::ASCIIToUTF16(kPushMessagingForcedNotificationTag); 390 base::ASCIIToUTF16(kPushMessagingForcedNotificationTag);
391 notification_data.icon = GURL(); // TODO(johnme): Better icon? 391 notification_data.icon = GURL(); // TODO(johnme): Better icon?
392 PlatformNotificationServiceImpl* notification_service = 392 PlatformNotificationServiceImpl* notification_service =
393 PlatformNotificationServiceImpl::GetInstance(); 393 PlatformNotificationServiceImpl::GetInstance();
394 notification_service->DisplayPersistentNotification( 394 notification_service->DisplayPersistentNotification(
395 profile_, 395 profile_,
396 application_id.service_worker_registration_id, 396 application_id.service_worker_registration_id,
397 application_id.origin, 397 application_id.origin,
398 SkBitmap() /* icon */, 398 SkBitmap() /* icon */,
399 notification_data, 399 notification_data);
400 content::ChildProcessHost::kInvalidUniqueID /* render_process_id */);
401 } 400 }
402 } 401 }
403 402
404 void PushMessagingServiceImpl::OnMessagesDeleted(const std::string& app_id) { 403 void PushMessagingServiceImpl::OnMessagesDeleted(const std::string& app_id) {
405 // TODO(mvanouwerkerk): Fire push error event on the Service Worker 404 // TODO(mvanouwerkerk): Fire push error event on the Service Worker
406 // corresponding to app_id. 405 // corresponding to app_id.
407 } 406 }
408 407
409 void PushMessagingServiceImpl::OnSendError( 408 void PushMessagingServiceImpl::OnSendError(
410 const std::string& app_id, 409 const std::string& app_id,
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 bool PushMessagingServiceImpl::HasPermission(const GURL& origin) { 638 bool PushMessagingServiceImpl::HasPermission(const GURL& origin) {
640 gcm::PushMessagingPermissionContext* permission_context = 639 gcm::PushMessagingPermissionContext* permission_context =
641 gcm::PushMessagingPermissionContextFactory::GetForProfile(profile_); 640 gcm::PushMessagingPermissionContextFactory::GetForProfile(profile_);
642 DCHECK(permission_context); 641 DCHECK(permission_context);
643 642
644 return permission_context->GetPermissionStatus(origin, origin) == 643 return permission_context->GetPermissionStatus(origin, origin) ==
645 CONTENT_SETTING_ALLOW; 644 CONTENT_SETTING_ALLOW;
646 } 645 }
647 646
648 } // namespace gcm 647 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698