OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/tools/test_shell/notification_presenter.h" | 5 #include "webkit/tools/test_shell/notification_presenter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotification.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotification.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 using WebKit::WebString; | 21 using WebKit::WebString; |
22 using WebKit::WebTextDirectionRightToLeft; | 22 using WebKit::WebTextDirectionRightToLeft; |
23 using WebKit::WebURL; | 23 using WebKit::WebURL; |
24 | 24 |
25 namespace { | 25 namespace { |
26 void DeferredDisplayDispatch(WebNotification notification) { | 26 void DeferredDisplayDispatch(WebNotification notification) { |
27 notification.dispatchDisplayEvent(); | 27 notification.dispatchDisplayEvent(); |
28 } | 28 } |
29 } | 29 } |
30 | 30 |
31 TestNotificationPresenter::TestNotificationPresenter(TestShell* shell) | 31 TestNotificationPresenter::TestNotificationPresenter(TestShell* shell) { |
32 : shell_(shell) { | |
33 } | 32 } |
34 | 33 |
35 TestNotificationPresenter::~TestNotificationPresenter() {} | 34 TestNotificationPresenter::~TestNotificationPresenter() {} |
36 | 35 |
37 void TestNotificationPresenter::Reset() { | 36 void TestNotificationPresenter::Reset() { |
38 allowed_origins_.clear(); | 37 allowed_origins_.clear(); |
39 } | 38 } |
40 | 39 |
41 void TestNotificationPresenter::grantPermission(const std::string& origin) { | 40 void TestNotificationPresenter::grantPermission(const std::string& origin) { |
42 allowed_origins_.insert(origin); | 41 allowed_origins_.insert(origin); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 : WebNotificationPresenter::PermissionDenied; | 102 : WebNotificationPresenter::PermissionDenied; |
104 } | 103 } |
105 | 104 |
106 void TestNotificationPresenter::requestPermission( | 105 void TestNotificationPresenter::requestPermission( |
107 const WebSecurityOrigin& origin, | 106 const WebSecurityOrigin& origin, |
108 WebNotificationPermissionCallback* callback) { | 107 WebNotificationPermissionCallback* callback) { |
109 printf("DESKTOP NOTIFICATION PERMISSION REQUESTED: %s\n", | 108 printf("DESKTOP NOTIFICATION PERMISSION REQUESTED: %s\n", |
110 origin.toString().utf8().data()); | 109 origin.toString().utf8().data()); |
111 callback->permissionRequestComplete(); | 110 callback->permissionRequestComplete(); |
112 } | 111 } |
OLD | NEW |