OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/local_discovery/privet_notifications_factory.h" | 5 #include "chrome/browser/local_discovery/privet_notifications_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/local_discovery/privet_notifications.h" | 9 #include "chrome/browser/local_discovery/privet_notifications.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 "PrivetNotificationService", | 22 "PrivetNotificationService", |
23 BrowserContextDependencyManager::GetInstance()) { | 23 BrowserContextDependencyManager::GetInstance()) { |
24 } | 24 } |
25 | 25 |
26 PrivetNotificationServiceFactory::~PrivetNotificationServiceFactory() { | 26 PrivetNotificationServiceFactory::~PrivetNotificationServiceFactory() { |
27 } | 27 } |
28 | 28 |
29 BrowserContextKeyedService* | 29 BrowserContextKeyedService* |
30 PrivetNotificationServiceFactory::BuildServiceInstanceFor( | 30 PrivetNotificationServiceFactory::BuildServiceInstanceFor( |
31 content::BrowserContext* profile) const { | 31 content::BrowserContext* profile) const { |
32 return new PrivetNotificationService( | 32 return new PrivetNotificationService(profile); |
33 profile, g_browser_process->notification_ui_manager()); | |
34 } | 33 } |
35 | 34 |
36 bool | 35 bool |
37 PrivetNotificationServiceFactory::ServiceIsCreatedWithBrowserContext() const { | 36 PrivetNotificationServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
38 // TODO(vitalybuka): re-enable after fixing broken tests. | 37 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
39 return false; | 38 using switches::kDisableDeviceDiscovery; |
40 return !CommandLine::ForCurrentProcess()->HasSwitch( | 39 using switches::kDisableDeviceDiscoveryNotifications; |
41 switches::kDisableDeviceDiscovery); | 40 return !command_line->HasSwitch(kDisableDeviceDiscovery) && |
| 41 !command_line->HasSwitch(kDisableDeviceDiscoveryNotifications); |
42 } | 42 } |
43 | 43 |
44 bool PrivetNotificationServiceFactory::ServiceIsNULLWhileTesting() const { | 44 bool PrivetNotificationServiceFactory::ServiceIsNULLWhileTesting() const { |
45 return true; | 45 return true; |
46 } | 46 } |
47 | 47 |
48 } // namespace local_discovery | 48 } // namespace local_discovery |
OLD | NEW |