Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / notifications / persistent_notification_delegate.cc
blob9ac9837ca4ff262d59334bfde5d8ce0ccc20657f
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
3 // found in the LICENSE file.
5 #include "chrome/browser/notifications/persistent_notification_delegate.h"
7 #include "base/bind.h"
8 #include "base/guid.h"
9 #include "chrome/browser/notifications/platform_notification_service_impl.h"
10 #include "content/public/common/persistent_notification_status.h"
12 namespace {
14 // Persistent notifications fired through the delegate do not care about the
15 // lifetime of the Service Worker responsible for executing the event.
16 void OnEventDispatchComplete(content::PersistentNotificationStatus status) {}
18 } // namespace
20 PersistentNotificationDelegate::PersistentNotificationDelegate(
21 content::BrowserContext* browser_context,
22 int64 service_worker_registration_id,
23 const GURL& origin,
24 const content::PlatformNotificationData& notification_data)
25 : browser_context_(browser_context),
26 service_worker_registration_id_(service_worker_registration_id),
27 origin_(origin),
28 notification_data_(notification_data),
29 id_(base::GenerateGUID()) {}
31 PersistentNotificationDelegate::~PersistentNotificationDelegate() {}
33 void PersistentNotificationDelegate::Display() {}
35 void PersistentNotificationDelegate::Close(bool by_user) {}
37 void PersistentNotificationDelegate::Click() {
38 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick(
39 browser_context_,
40 service_worker_registration_id_,
41 id_,
42 origin_,
43 notification_data_,
44 base::Bind(&OnEventDispatchComplete));
47 std::string PersistentNotificationDelegate::id() const {
48 return id_;