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

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

Issue 2794103002: Add initial support for native Linux desktop notifications (Closed)
Patch Set: Remove unused import 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 BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS)
637 if (!created_notification_bridge_) 637 if (!created_notification_bridge_)
638 CreateNotificationPlatformBridge(); 638 CreateNotificationPlatformBridge();
639 return notification_bridge_.get(); 639 return notification_bridge_.get();
640 #else 640 #else
641 return nullptr; 641 return nullptr;
642 #endif 642 #endif
643 } 643 }
644 644
645 message_center::MessageCenter* BrowserProcessImpl::message_center() { 645 message_center::MessageCenter* BrowserProcessImpl::message_center() {
646 DCHECK(CalledOnValidThread()); 646 DCHECK(CalledOnValidThread());
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 } 1155 }
1156 1156
1157 void BrowserProcessImpl::CreateIntranetRedirectDetector() { 1157 void BrowserProcessImpl::CreateIntranetRedirectDetector() {
1158 DCHECK(!intranet_redirect_detector_); 1158 DCHECK(!intranet_redirect_detector_);
1159 std::unique_ptr<IntranetRedirectDetector> intranet_redirect_detector( 1159 std::unique_ptr<IntranetRedirectDetector> intranet_redirect_detector(
1160 new IntranetRedirectDetector); 1160 new IntranetRedirectDetector);
1161 intranet_redirect_detector_.swap(intranet_redirect_detector); 1161 intranet_redirect_detector_.swap(intranet_redirect_detector);
1162 } 1162 }
1163 1163
1164 void BrowserProcessImpl::CreateNotificationPlatformBridge() { 1164 void BrowserProcessImpl::CreateNotificationPlatformBridge() {
1165 #if (defined(OS_ANDROID) || defined(OS_MACOSX)) 1165 #if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS)
1166 DCHECK(!notification_bridge_); 1166 DCHECK(!notification_bridge_);
1167 notification_bridge_.reset(NotificationPlatformBridge::Create()); 1167 notification_bridge_.reset(NotificationPlatformBridge::Create());
1168 created_notification_bridge_ = true; 1168 created_notification_bridge_ = true;
1169 #endif 1169 #endif
1170 } 1170 }
1171 1171
1172 void BrowserProcessImpl::CreateNotificationUIManager() { 1172 void BrowserProcessImpl::CreateNotificationUIManager() {
1173 // Android does not use the NotificationUIManager anymore 1173 // Android does not use the NotificationUIManager anymore
1174 // All notification traffic is routed through NotificationPlatformBridge. 1174 // All notification traffic is routed through NotificationPlatformBridge.
1175 #if !defined(OS_ANDROID) 1175 #if !defined(OS_ANDROID)
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 } 1435 }
1436 1436
1437 void BrowserProcessImpl::OnAutoupdateTimer() { 1437 void BrowserProcessImpl::OnAutoupdateTimer() {
1438 if (CanAutorestartForUpdate()) { 1438 if (CanAutorestartForUpdate()) {
1439 DLOG(WARNING) << "Detected update. Restarting browser."; 1439 DLOG(WARNING) << "Detected update. Restarting browser.";
1440 RestartBackgroundInstance(); 1440 RestartBackgroundInstance();
1441 } 1441 }
1442 } 1442 }
1443 1443
1444 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1444 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/notifications/notification_display_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698