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

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

Issue 776813004: Introduce new content APIs for persistent notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-sw-contentclient
Patch Set: Created 6 years 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
« no previous file with comments | « content/shell/browser/layout_test/layout_test_notification_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/desktop_notification_delegate.h" 9 #include "content/public/browser/desktop_notification_delegate.h"
10 #include "content/public/common/show_desktop_notification_params.h" 10 #include "content/public/common/show_desktop_notification_params.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 } 78 }
79 79
80 replacements_[replace_id] = title; 80 replacements_[replace_id] = title;
81 } 81 }
82 82
83 notifications_[title] = delegate.release(); 83 notifications_[title] = delegate.release();
84 notifications_[title]->NotificationDisplayed(); 84 notifications_[title]->NotificationDisplayed();
85 } 85 }
86 86
87 void LayoutTestNotificationManager::DisplayPersistentNotification(
88 BrowserContext* browser_context,
89 int64 service_worker_registration_id,
90 const ShowDesktopNotificationHostMsgParams& params,
91 int render_process_id) {
92 // TODO(peter): Make persistent notifications layout testable.
93 NOTIMPLEMENTED();
94 }
95
96 void LayoutTestNotificationManager::ClosePersistentNotification(
97 BrowserContext* browser_context,
98 const std::string& persistent_notification_id) {
99 // TODO(peter): Make persistent notifications layout testable.
100 NOTIMPLEMENTED();
101 }
102
87 void LayoutTestNotificationManager::SimulateClick(const std::string& title) { 103 void LayoutTestNotificationManager::SimulateClick(const std::string& title) {
88 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 104 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
89 auto iterator = notifications_.find(title); 105 auto iterator = notifications_.find(title);
90 if (iterator == notifications_.end()) 106 if (iterator == notifications_.end())
91 return; 107 return;
92 108
93 iterator->second->NotificationClick(); 109 iterator->second->NotificationClick();
94 } 110 }
95 111
96 void LayoutTestNotificationManager::Close(const std::string& title) { 112 void LayoutTestNotificationManager::Close(const std::string& title) {
97 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
98 auto iterator = notifications_.find(title); 114 auto iterator = notifications_.find(title);
99 if (iterator == notifications_.end()) 115 if (iterator == notifications_.end())
100 return; 116 return;
101 117
102 iterator->second->NotificationClosed(false); 118 iterator->second->NotificationClosed(false);
103 } 119 }
104 120
105 } // namespace content 121 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/layout_test/layout_test_notification_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698