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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.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/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/local_discovery/privet_device_lister_impl.h" | 15 #include "chrome/browser/local_discovery/privet_device_lister_impl.h" |
16 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" | 16 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" |
17 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" | 17 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" |
18 #include "chrome/browser/notifications/notification.h" | 18 #include "chrome/browser/notifications/notification.h" |
19 #include "chrome/browser/notifications/notification_ui_manager.h" | 19 #include "chrome/browser/notifications/notification_ui_manager.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/signin/signin_manager_factory.h" | 21 #include "chrome/browser/signin/signin_manager_factory.h" |
22 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
23 #include "chrome/browser/ui/browser_finder.h" | 23 #include "chrome/browser/ui/browser_finder.h" |
24 #include "chrome/browser/ui/browser_window.h" | 24 #include "chrome/browser/ui/browser_window.h" |
25 #include "chrome/browser/ui/host_desktop.h" | 25 #include "chrome/browser/ui/host_desktop.h" |
26 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 26 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
27 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" | 27 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" |
28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
| 30 #include "chrome/grit/generated_resources.h" |
30 #include "components/signin/core/browser/signin_manager_base.h" | 31 #include "components/signin/core/browser/signin_manager_base.h" |
31 #include "content/public/browser/browser_context.h" | 32 #include "content/public/browser/browser_context.h" |
32 #include "content/public/browser/navigation_controller.h" | 33 #include "content/public/browser/navigation_controller.h" |
33 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
34 #include "content/public/common/page_transition_types.h" | 35 #include "content/public/common/page_transition_types.h" |
35 #include "grit/generated_resources.h" | |
36 #include "grit/theme_resources.h" | 36 #include "grit/theme_resources.h" |
37 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
38 #include "ui/base/resource/resource_bundle.h" | 38 #include "ui/base/resource/resource_bundle.h" |
39 #include "ui/message_center/notifier_settings.h" | 39 #include "ui/message_center/notifier_settings.h" |
40 | 40 |
41 #if defined(ENABLE_MDNS) | 41 #if defined(ENABLE_MDNS) |
42 #include "chrome/browser/local_discovery/privet_traffic_detector.h" | 42 #include "chrome/browser/local_discovery/privet_traffic_detector.h" |
43 #endif | 43 #endif |
44 | 44 |
45 namespace local_discovery { | 45 namespace local_discovery { |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 407 |
408 void PrivetNotificationDelegate::DisableNotifications() { | 408 void PrivetNotificationDelegate::DisableNotifications() { |
409 Profile* profile_obj = Profile::FromBrowserContext(profile_); | 409 Profile* profile_obj = Profile::FromBrowserContext(profile_); |
410 | 410 |
411 profile_obj->GetPrefs()->SetBoolean( | 411 profile_obj->GetPrefs()->SetBoolean( |
412 prefs::kLocalDiscoveryNotificationsEnabled, | 412 prefs::kLocalDiscoveryNotificationsEnabled, |
413 false); | 413 false); |
414 } | 414 } |
415 | 415 |
416 } // namespace local_discovery | 416 } // namespace local_discovery |
OLD | NEW |