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

Side by Side Diff: content/shell/browser/layout_test/layout_test_notification_manager.cc

Issue 1269923003: Plumb notification action index for desktop SW notificationclick (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@actions
Patch Set: Created 5 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
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 "content/shell/browser/layout_test/layout_test_notification_manager.h" 5 #include "content/shell/browser/layout_test/layout_test_notification_manager.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/desktop_notification_delegate.h" 10 #include "content/public/browser/desktop_notification_delegate.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 const auto& persistent_iterator = persistent_notifications_.find(title); 120 const auto& persistent_iterator = persistent_notifications_.find(title);
121 if (persistent_iterator == persistent_notifications_.end()) 121 if (persistent_iterator == persistent_notifications_.end())
122 return; 122 return;
123 123
124 const PersistentNotification& notification = persistent_iterator->second; 124 const PersistentNotification& notification = persistent_iterator->second;
125 content::NotificationEventDispatcher::GetInstance() 125 content::NotificationEventDispatcher::GetInstance()
126 ->DispatchNotificationClickEvent( 126 ->DispatchNotificationClickEvent(
127 notification.browser_context, 127 notification.browser_context,
128 notification.persistent_id, 128 notification.persistent_id,
129 notification.origin, 129 notification.origin,
130 -1 /* action_index */,
130 base::Bind(&OnEventDispatchComplete)); 131 base::Bind(&OnEventDispatchComplete));
131 } 132 }
132 133
133 blink::WebNotificationPermission 134 blink::WebNotificationPermission
134 LayoutTestNotificationManager::CheckPermissionOnUIThread( 135 LayoutTestNotificationManager::CheckPermissionOnUIThread(
135 BrowserContext* browser_context, 136 BrowserContext* browser_context,
136 const GURL& origin, 137 const GURL& origin,
137 int render_process_id) { 138 int render_process_id) {
138 DCHECK_CURRENTLY_ON(BrowserThread::UI); 139 DCHECK_CURRENTLY_ON(BrowserThread::UI);
139 return CheckPermission(origin); 140 return CheckPermission(origin);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 LayoutTestNotificationManager::CheckPermission(const GURL& origin) { 193 LayoutTestNotificationManager::CheckPermission(const GURL& origin) {
193 return ToWebNotificationPermission(LayoutTestContentBrowserClient::Get() 194 return ToWebNotificationPermission(LayoutTestContentBrowserClient::Get()
194 ->GetLayoutTestBrowserContext() 195 ->GetLayoutTestBrowserContext()
195 ->GetLayoutTestPermissionManager() 196 ->GetLayoutTestPermissionManager()
196 ->GetPermissionStatus(PermissionType::NOTIFICATIONS, 197 ->GetPermissionStatus(PermissionType::NOTIFICATIONS,
197 origin, 198 origin,
198 origin)); 199 origin));
199 } 200 }
200 201
201 } // namespace content 202 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698