OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |