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.h" | 5 #include "chrome/browser/local_discovery/privet_notifications.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/local_discovery/privet_device_lister_impl.h" | 17 #include "chrome/browser/local_discovery/privet_device_lister_impl.h" |
18 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" | 18 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" |
19 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" | 19 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" |
20 #include "chrome/browser/notifications/notification.h" | 20 #include "chrome/browser/notifications/notification.h" |
21 #include "chrome/browser/notifications/notification_ui_manager.h" | 21 #include "chrome/browser/notifications/notification_ui_manager.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/signin/signin_manager_factory.h" | 23 #include "chrome/browser/signin/signin_manager_factory.h" |
24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
25 #include "chrome/browser/ui/browser_finder.h" | 25 #include "chrome/browser/ui/browser_finder.h" |
26 #include "chrome/browser/ui/browser_window.h" | 26 #include "chrome/browser/ui/browser_window.h" |
27 #include "chrome/browser/ui/host_desktop.h" | |
28 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
29 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" | 28 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" |
30 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
31 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
32 #include "chrome/grit/generated_resources.h" | 31 #include "chrome/grit/generated_resources.h" |
33 #include "components/signin/core/browser/signin_manager_base.h" | 32 #include "components/signin/core/browser/signin_manager_base.h" |
34 #include "content/public/browser/browser_context.h" | 33 #include "content/public/browser/browser_context.h" |
35 #include "content/public/browser/navigation_controller.h" | 34 #include "content/public/browser/navigation_controller.h" |
36 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
37 #include "grit/theme_resources.h" | 36 #include "grit/theme_resources.h" |
38 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
39 #include "ui/base/page_transition_types.h" | 38 #include "ui/base/page_transition_types.h" |
40 #include "ui/base/resource/resource_bundle.h" | 39 #include "ui/base/resource/resource_bundle.h" |
| 40 #include "ui/gfx/host_desktop_type.h" |
41 #include "ui/message_center/notifier_settings.h" | 41 #include "ui/message_center/notifier_settings.h" |
42 | 42 |
43 #if defined(ENABLE_MDNS) | 43 #if defined(ENABLE_MDNS) |
44 #include "chrome/browser/local_discovery/privet_traffic_detector.h" | 44 #include "chrome/browser/local_discovery/privet_traffic_detector.h" |
45 #endif | 45 #endif |
46 | 46 |
47 namespace local_discovery { | 47 namespace local_discovery { |
48 | 48 |
49 namespace { | 49 namespace { |
50 | 50 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 void PrivetNotificationDelegate::DisableNotifications() { | 381 void PrivetNotificationDelegate::DisableNotifications() { |
382 Profile* profile_obj = Profile::FromBrowserContext(profile_); | 382 Profile* profile_obj = Profile::FromBrowserContext(profile_); |
383 | 383 |
384 profile_obj->GetPrefs()->SetBoolean( | 384 profile_obj->GetPrefs()->SetBoolean( |
385 prefs::kLocalDiscoveryNotificationsEnabled, | 385 prefs::kLocalDiscoveryNotificationsEnabled, |
386 false); | 386 false); |
387 } | 387 } |
388 | 388 |
389 } // namespace local_discovery | 389 } // namespace local_discovery |
OLD | NEW |