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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 2794103002: Add initial support for native Linux desktop notifications (Closed)
Patch Set: Rebase, address peter@'s comments Created 3 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 #if defined(OS_ANDROID) 626 #if defined(OS_ANDROID)
627 return nullptr; 627 return nullptr;
628 #else 628 #else
629 if (!created_notification_ui_manager_) 629 if (!created_notification_ui_manager_)
630 CreateNotificationUIManager(); 630 CreateNotificationUIManager();
631 return notification_ui_manager_.get(); 631 return notification_ui_manager_.get();
632 #endif 632 #endif
633 } 633 }
634 634
635 NotificationPlatformBridge* BrowserProcessImpl::notification_platform_bridge() { 635 NotificationPlatformBridge* BrowserProcessImpl::notification_platform_bridge() {
636 #if defined(OS_ANDROID) || defined(OS_MACOSX) 636 #if defined(OS_ANDROID) || defined(OS_MACOSX) || \
637 (defined(OS_LINUX) && !defined(OS_CHROMEOS))
637 if (!created_notification_bridge_) 638 if (!created_notification_bridge_)
638 CreateNotificationPlatformBridge(); 639 CreateNotificationPlatformBridge();
639 return notification_bridge_.get(); 640 return notification_bridge_.get();
640 #else 641 #else
641 return nullptr; 642 return nullptr;
642 #endif 643 #endif
643 } 644 }
644 645
645 message_center::MessageCenter* BrowserProcessImpl::message_center() { 646 message_center::MessageCenter* BrowserProcessImpl::message_center() {
646 DCHECK(CalledOnValidThread()); 647 DCHECK(CalledOnValidThread());
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 } 1156 }
1156 1157
1157 void BrowserProcessImpl::CreateIntranetRedirectDetector() { 1158 void BrowserProcessImpl::CreateIntranetRedirectDetector() {
1158 DCHECK(!intranet_redirect_detector_); 1159 DCHECK(!intranet_redirect_detector_);
1159 std::unique_ptr<IntranetRedirectDetector> intranet_redirect_detector( 1160 std::unique_ptr<IntranetRedirectDetector> intranet_redirect_detector(
1160 new IntranetRedirectDetector); 1161 new IntranetRedirectDetector);
1161 intranet_redirect_detector_.swap(intranet_redirect_detector); 1162 intranet_redirect_detector_.swap(intranet_redirect_detector);
1162 } 1163 }
1163 1164
1164 void BrowserProcessImpl::CreateNotificationPlatformBridge() { 1165 void BrowserProcessImpl::CreateNotificationPlatformBridge() {
1165 #if (defined(OS_ANDROID) || defined(OS_MACOSX)) 1166 #if defined(OS_ANDROID) || defined(OS_MACOSX) || \
1167 (defined(OS_LINUX) && !defined(OS_CHROMEOS))
1166 DCHECK(!notification_bridge_); 1168 DCHECK(!notification_bridge_);
1167 notification_bridge_.reset(NotificationPlatformBridge::Create()); 1169 notification_bridge_.reset(NotificationPlatformBridge::Create());
1168 created_notification_bridge_ = true; 1170 created_notification_bridge_ = true;
1169 #endif 1171 #endif
1170 } 1172 }
1171 1173
1172 void BrowserProcessImpl::CreateNotificationUIManager() { 1174 void BrowserProcessImpl::CreateNotificationUIManager() {
1173 // Android does not use the NotificationUIManager anymore 1175 // Android does not use the NotificationUIManager anymore
1174 // All notification traffic is routed through NotificationPlatformBridge. 1176 // All notification traffic is routed through NotificationPlatformBridge.
1175 #if !defined(OS_ANDROID) 1177 #if !defined(OS_ANDROID)
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 } 1437 }
1436 1438
1437 void BrowserProcessImpl::OnAutoupdateTimer() { 1439 void BrowserProcessImpl::OnAutoupdateTimer() {
1438 if (CanAutorestartForUpdate()) { 1440 if (CanAutorestartForUpdate()) {
1439 DLOG(WARNING) << "Detected update. Restarting browser."; 1441 DLOG(WARNING) << "Detected update. Restarting browser.";
1440 RestartBackgroundInstance(); 1442 RestartBackgroundInstance();
1441 } 1443 }
1442 } 1444 }
1443 1445
1444 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1446 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698