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

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

Issue 1942353002: (reland) Move permission.mojom from WebKit/public/platform/ to components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 const PersistentNotification& notification = persistent_iterator->second; 130 const PersistentNotification& notification = persistent_iterator->second;
131 content::NotificationEventDispatcher::GetInstance() 131 content::NotificationEventDispatcher::GetInstance()
132 ->DispatchNotificationCloseEvent( 132 ->DispatchNotificationCloseEvent(
133 notification.browser_context, 133 notification.browser_context,
134 notification.persistent_id, 134 notification.persistent_id,
135 notification.origin, 135 notification.origin,
136 by_user, 136 by_user,
137 base::Bind(&OnEventDispatchComplete)); 137 base::Bind(&OnEventDispatchComplete));
138 } 138 }
139 139
140 blink::mojom::PermissionStatus 140 permissions::mojom::PermissionStatus
141 LayoutTestNotificationManager::CheckPermissionOnUIThread( 141 LayoutTestNotificationManager::CheckPermissionOnUIThread(
142 BrowserContext* browser_context, 142 BrowserContext* browser_context,
143 const GURL& origin, 143 const GURL& origin,
144 int render_process_id) { 144 int render_process_id) {
145 DCHECK_CURRENTLY_ON(BrowserThread::UI); 145 DCHECK_CURRENTLY_ON(BrowserThread::UI);
146 return CheckPermission(origin); 146 return CheckPermission(origin);
147 } 147 }
148 148
149 blink::mojom::PermissionStatus 149 permissions::mojom::PermissionStatus
150 LayoutTestNotificationManager::CheckPermissionOnIOThread( 150 LayoutTestNotificationManager::CheckPermissionOnIOThread(
151 ResourceContext* resource_context, 151 ResourceContext* resource_context,
152 const GURL& origin, 152 const GURL& origin,
153 int render_process_id) { 153 int render_process_id) {
154 DCHECK_CURRENTLY_ON(BrowserThread::IO); 154 DCHECK_CURRENTLY_ON(BrowserThread::IO);
155 return CheckPermission(origin); 155 return CheckPermission(origin);
156 } 156 }
157 157
158 void LayoutTestNotificationManager::Close(const std::string& title) { 158 void LayoutTestNotificationManager::Close(const std::string& title) {
159 DCHECK_CURRENTLY_ON(BrowserThread::UI); 159 DCHECK_CURRENTLY_ON(BrowserThread::UI);
(...skipping 28 matching lines...) Expand all
188 188
189 const auto& persistent_notification_iter = 189 const auto& persistent_notification_iter =
190 persistent_notifications_.find(previous_title); 190 persistent_notifications_.find(previous_title);
191 if (persistent_notification_iter != persistent_notifications_.end()) 191 if (persistent_notification_iter != persistent_notifications_.end())
192 persistent_notifications_.erase(persistent_notification_iter); 192 persistent_notifications_.erase(persistent_notification_iter);
193 } 193 }
194 194
195 replacements_[tag] = base::UTF16ToUTF8(notification_data.title); 195 replacements_[tag] = base::UTF16ToUTF8(notification_data.title);
196 } 196 }
197 197
198 blink::mojom::PermissionStatus 198 permissions::mojom::PermissionStatus
199 LayoutTestNotificationManager::CheckPermission(const GURL& origin) { 199 LayoutTestNotificationManager::CheckPermission(const GURL& origin) {
200 return LayoutTestContentBrowserClient::Get() 200 return LayoutTestContentBrowserClient::Get()
201 ->GetLayoutTestBrowserContext() 201 ->GetLayoutTestBrowserContext()
202 ->GetLayoutTestPermissionManager() 202 ->GetLayoutTestPermissionManager()
203 ->GetPermissionStatus(PermissionType::NOTIFICATIONS, 203 ->GetPermissionStatus(PermissionType::NOTIFICATIONS,
204 origin, 204 origin,
205 origin); 205 origin);
206 } 206 }
207 207
208 } // namespace content 208 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698