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

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

Issue 2033093003: [Notification] Make HTML5 Notification use ActionCenter on Windows 10, behind Flags. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 #if defined(OS_ANDROID) 568 #if defined(OS_ANDROID)
569 return nullptr; 569 return nullptr;
570 #else 570 #else
571 if (!created_notification_ui_manager_) 571 if (!created_notification_ui_manager_)
572 CreateNotificationUIManager(); 572 CreateNotificationUIManager();
573 return notification_ui_manager_.get(); 573 return notification_ui_manager_.get();
574 #endif 574 #endif
575 } 575 }
576 576
577 NotificationPlatformBridge* BrowserProcessImpl::notification_platform_bridge() { 577 NotificationPlatformBridge* BrowserProcessImpl::notification_platform_bridge() {
578 #if defined(OS_ANDROID) || defined(OS_MACOSX) 578 #if defined(OS_WIN) || defined(OS_ANDROID) || defined(OS_MACOSX)
579 if (!created_notification_bridge_) 579 if (!created_notification_bridge_)
580 CreateNotificationPlatformBridge(); 580 CreateNotificationPlatformBridge();
581 return notification_bridge_.get(); 581 return notification_bridge_.get();
582 #else 582 #else
583 return nullptr; 583 return nullptr;
584 #endif 584 #endif
585 } 585 }
586 586
587 message_center::MessageCenter* BrowserProcessImpl::message_center() { 587 message_center::MessageCenter* BrowserProcessImpl::message_center() {
588 DCHECK(CalledOnValidThread()); 588 DCHECK(CalledOnValidThread());
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 } 1055 }
1056 1056
1057 void BrowserProcessImpl::CreateIntranetRedirectDetector() { 1057 void BrowserProcessImpl::CreateIntranetRedirectDetector() {
1058 DCHECK(intranet_redirect_detector_.get() == NULL); 1058 DCHECK(intranet_redirect_detector_.get() == NULL);
1059 std::unique_ptr<IntranetRedirectDetector> intranet_redirect_detector( 1059 std::unique_ptr<IntranetRedirectDetector> intranet_redirect_detector(
1060 new IntranetRedirectDetector); 1060 new IntranetRedirectDetector);
1061 intranet_redirect_detector_.swap(intranet_redirect_detector); 1061 intranet_redirect_detector_.swap(intranet_redirect_detector);
1062 } 1062 }
1063 1063
1064 void BrowserProcessImpl::CreateNotificationPlatformBridge() { 1064 void BrowserProcessImpl::CreateNotificationPlatformBridge() {
1065 #if (defined(OS_ANDROID) || defined(OS_MACOSX)) && defined(ENABLE_NOTIFICATIONS) 1065 #if defined(ENABLE_NOTIFICATIONS)
1066 #if defined(OS_WIN) || defined(OS_ANDROID) || defined(OS_MACOSX)
1066 DCHECK(notification_bridge_.get() == NULL); 1067 DCHECK(notification_bridge_.get() == NULL);
1067 notification_bridge_.reset(NotificationPlatformBridge::Create()); 1068 notification_bridge_.reset(NotificationPlatformBridge::Create());
1068 created_notification_bridge_ = true; 1069 created_notification_bridge_ = true;
1069 #endif 1070 #endif
1071 #endif
1070 } 1072 }
1071 1073
1072 void BrowserProcessImpl::CreateNotificationUIManager() { 1074 void BrowserProcessImpl::CreateNotificationUIManager() {
1073 // Android does not use the NotificationUIManager anuymore 1075 // Android does not use the NotificationUIManager anuymore
1074 // All notification traffic is routed through NotificationPlatformBridge. 1076 // All notification traffic is routed through NotificationPlatformBridge.
1075 #if defined(ENABLE_NOTIFICATIONS) && !defined(OS_ANDROID) 1077 #if defined(ENABLE_NOTIFICATIONS) && !defined(OS_ANDROID)
1076 DCHECK(notification_ui_manager_.get() == NULL); 1078 DCHECK(notification_ui_manager_.get() == NULL);
1077 notification_ui_manager_.reset(NotificationUIManager::Create(local_state())); 1079 notification_ui_manager_.reset(NotificationUIManager::Create(local_state()));
1078 created_notification_ui_manager_ = true; 1080 created_notification_ui_manager_ = true;
1079 #endif 1081 #endif
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 } 1298 }
1297 1299
1298 void BrowserProcessImpl::OnAutoupdateTimer() { 1300 void BrowserProcessImpl::OnAutoupdateTimer() {
1299 if (CanAutorestartForUpdate()) { 1301 if (CanAutorestartForUpdate()) {
1300 DLOG(WARNING) << "Detected update. Restarting browser."; 1302 DLOG(WARNING) << "Detected update. Restarting browser.";
1301 RestartBackgroundInstance(); 1303 RestartBackgroundInstance();
1302 } 1304 }
1303 } 1305 }
1304 1306
1305 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1307 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698