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

Side by Side Diff: chrome/browser/local_discovery/privet_notifications_factory.cc

Issue 23903024: Enable device discovery notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/local_discovery/privet_notifications.cc ('k') | chrome/browser/task_manager/task_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698