summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/generated_resources.grd6
-rw-r--r--chrome/browser/about_flags.cc9
-rw-r--r--chrome/browser/local_discovery/privet_notifications.cc13
-rw-r--r--chrome/browser/local_discovery/privet_notifications.h4
-rw-r--r--chrome/browser/local_discovery/privet_notifications_factory.cc12
-rw-r--r--chrome/browser/task_manager/task_manager_browsertest.cc3
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome_frame/test/net/fake_external_tab.cc3
9 files changed, 15 insertions, 40 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 22785b4..7699b1a 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5471,12 +5471,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_DESCRIPTION" desc="Description for 'disable device discovery' flag.">
Disable device discovery on local network.
</message>
- <message name="IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_NOTIFICATIONS_NAME" desc="Title of the disable 'disable device discovery notificatios' flag.">
- Disable Device Discovery Notifications
- </message>
- <message name="IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION" desc="Description for 'disable device discovery notifications' flag.">
- Disable device discovery notifications on local network.
- </message>
<message name="IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME" desc="Title of the touch-optimized UI flag." >
Touch Optimized UI
</message>
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 21f7236..289e2cb 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1516,7 +1516,6 @@ const Experiment kExperiments[] = {
kOsAll,
SINGLE_VALUE_TYPE(switches::kSyncfsEnableDirectoryOperation),
},
-#if defined(ENABLE_MDNS)
{
"disable-device-discovery",
IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_NAME,
@@ -1524,14 +1523,6 @@ const Experiment kExperiments[] = {
kOsWin | kOsLinux | kOsCrOS,
SINGLE_VALUE_TYPE(switches::kDisableDeviceDiscovery)
},
- {
- "disable-device-discovery-notifications",
- IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_NOTIFICATIONS_NAME,
- IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION,
- kOsWin | kOsLinux | kOsCrOS,
- SINGLE_VALUE_TYPE(switches::kDisableDeviceDiscoveryNotifications)
- },
-#endif // ENABLE_MDNS
#if defined(OS_MACOSX)
{
"enable-app-list-shim",
diff --git a/chrome/browser/local_discovery/privet_notifications.cc b/chrome/browser/local_discovery/privet_notifications.cc
index 3498c57..b4165fe 100644
--- a/chrome/browser/local_discovery/privet_notifications.cc
+++ b/chrome/browser/local_discovery/privet_notifications.cc
@@ -8,7 +8,6 @@
#include "base/message_loop/message_loop.h"
#include "base/rand_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/local_discovery/privet_device_lister_impl.h"
#include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h"
#include "chrome/browser/local_discovery/service_discovery_host_client.h"
@@ -152,8 +151,10 @@ PrivetNotificationsListener::DeviceContext::~DeviceContext() {
}
PrivetNotificationService::PrivetNotificationService(
- content::BrowserContext* profile)
- : profile_(profile) {
+ content::BrowserContext* profile,
+ NotificationUIManager* notification_manager)
+ : profile_(profile),
+ notification_manager_(notification_manager) {
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PrivetNotificationService::Start, AsWeakPtr()),
@@ -211,15 +212,13 @@ void PrivetNotificationService::PrivetNotify(
rich_notification_data,
new PrivetNotificationDelegate(device_name, profile_));
- g_browser_process->notification_ui_manager()->Add(notification,
- profile_object);
+ notification_manager_->Add(notification, profile_object);
}
}
void PrivetNotificationService::PrivetRemoveNotification(
const std::string& device_name) {
- g_browser_process->notification_ui_manager()->CancelById(
- kPrivetNotificationIDPrefix + device_name);
+ notification_manager_->CancelById(kPrivetNotificationIDPrefix + device_name);
}
void PrivetNotificationService::Start() {
diff --git a/chrome/browser/local_discovery/privet_notifications.h b/chrome/browser/local_discovery/privet_notifications.h
index 1a84d49..3ca5621 100644
--- a/chrome/browser/local_discovery/privet_notifications.h
+++ b/chrome/browser/local_discovery/privet_notifications.h
@@ -93,7 +93,8 @@ class PrivetNotificationService
public PrivetNotificationsListener::Delegate,
public base::SupportsWeakPtr<PrivetNotificationService> {
public:
- explicit PrivetNotificationService(content::BrowserContext* profile);
+ PrivetNotificationService(content::BrowserContext* profile,
+ NotificationUIManager* notification_manager);
virtual ~PrivetNotificationService();
// PrivetDeviceLister::Delegate implementation:
@@ -114,6 +115,7 @@ class PrivetNotificationService
void Start();
content::BrowserContext* profile_;
+ NotificationUIManager* notification_manager_;
scoped_ptr<PrivetDeviceLister> device_lister_;
scoped_refptr<ServiceDiscoverySharedClient> service_discovery_client_;
scoped_ptr<PrivetNotificationsListener> privet_notifications_listener_;
diff --git a/chrome/browser/local_discovery/privet_notifications_factory.cc b/chrome/browser/local_discovery/privet_notifications_factory.cc
index f37edcd..305b37d 100644
--- a/chrome/browser/local_discovery/privet_notifications_factory.cc
+++ b/chrome/browser/local_discovery/privet_notifications_factory.cc
@@ -29,16 +29,16 @@ PrivetNotificationServiceFactory::~PrivetNotificationServiceFactory() {
BrowserContextKeyedService*
PrivetNotificationServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
- return new PrivetNotificationService(profile);
+ return new PrivetNotificationService(
+ profile, g_browser_process->notification_ui_manager());
}
bool
PrivetNotificationServiceFactory::ServiceIsCreatedWithBrowserContext() const {
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- using switches::kDisableDeviceDiscovery;
- using switches::kDisableDeviceDiscoveryNotifications;
- return !command_line->HasSwitch(kDisableDeviceDiscovery) &&
- !command_line->HasSwitch(kDisableDeviceDiscoveryNotifications);
+ // TODO(vitalybuka): re-enable after fixing broken tests.
+ return false;
+ return !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableDeviceDiscovery);
}
bool PrivetNotificationServiceFactory::ServiceIsNULLWhileTesting() const {
diff --git a/chrome/browser/task_manager/task_manager_browsertest.cc b/chrome/browser/task_manager/task_manager_browsertest.cc
index 045a988..6851bc4 100644
--- a/chrome/browser/task_manager/task_manager_browsertest.cc
+++ b/chrome/browser/task_manager/task_manager_browsertest.cc
@@ -104,9 +104,6 @@ class TaskManagerBrowserTest : public ExtensionBrowserTest {
// well defined.
command_line->AppendSwitch(switches::kDisableGpuProcessPrelaunch);
command_line->AppendSwitch(switches::kDisableAcceleratedCompositing);
-
- // Do not launch device discovery process.
- command_line->AppendSwitch(switches::kDisableDeviceDiscoveryNotifications);
}
private:
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index f7eda22..198a9aa 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -323,10 +323,6 @@ const char kDisableDefaultApps[] = "disable-default-apps";
// Disables device discovery.
const char kDisableDeviceDiscovery[] = "disable-device-discovery";
-// Disables device discovery notifications.
-const char kDisableDeviceDiscoveryNotifications[] =
- "disable-device-discovery-notifications";
-
// Disables retrieval of PAC URLs from DHCP as per the WPAD standard.
const char kDisableDhcpWpad[] = "disable-dhcp-wpad";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index d682002..c829a30 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -99,7 +99,6 @@ extern const char kDisableCRLSets[];
extern const char kDisableCustomJumpList[];
extern const char kDisableDefaultApps[];
extern const char kDisableDeviceDiscovery[];
-extern const char kDisableDeviceDiscoveryNotifications[];
extern const char kDisableDhcpWpad[];
extern const char kDisableDnsProbes[];
extern const char kDisableExtensionsFileAccessCheck[];
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc
index bcc7792..3922e96 100644
--- a/chrome_frame/test/net/fake_external_tab.cc
+++ b/chrome_frame/test/net/fake_external_tab.cc
@@ -523,9 +523,6 @@ void FakeExternalTab::Initialize() {
ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
CommandLine* cmd = CommandLine::ForCurrentProcess();
- // Disable Device Discovery with switch because this test does not respect
- // BrowserContextKeyedBaseFactory::ServiceIsNULLWhileTesting.
- cmd->AppendSwitch(switches::kDisableDeviceDiscoveryNotifications);
cmd->AppendSwitch(switches::kDisableWebResources);
cmd->AppendSwitch(switches::kSingleProcess);