| 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 17 matching lines...) Expand all Loading... |
| 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( |
| 33 profile, g_browser_process->notification_ui_manager()); | 33 profile, g_browser_process->notification_ui_manager()); |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool | 36 bool |
| 37 PrivetNotificationServiceFactory::ServiceIsCreatedWithBrowserContext() const { | 37 PrivetNotificationServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
| 38 // TODO(vitalybuka): re-enable after fixing broken tests. | 38 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 39 return false; | 39 return !command_line->HasSwitch(switches::kDisableDeviceDiscovery) && |
| 40 return !CommandLine::ForCurrentProcess()->HasSwitch( | 40 !command_line->HasSwitch(switches::kDisableDeviceDiscoveryNotifications); |
| 41 switches::kDisableDeviceDiscovery); | |
| 42 } | 41 } |
| 43 | 42 |
| 44 bool PrivetNotificationServiceFactory::ServiceIsNULLWhileTesting() const { | 43 bool PrivetNotificationServiceFactory::ServiceIsNULLWhileTesting() const { |
| 45 return true; | 44 return true; |
| 46 } | 45 } |
| 47 | 46 |
| 48 } // namespace local_discovery | 47 } // namespace local_discovery |
| OLD | NEW |