| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/network_profile_bubble.h" | 5 #include "chrome/browser/ui/network_profile_bubble.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <wtsapi32.h> | 10 #include <wtsapi32.h> |
| 11 // Make sure we link the wtsapi lib file in. | 11 // Make sure we link the wtsapi lib file in. |
| 12 #pragma comment(lib, "wtsapi32.lib") | 12 #pragma comment(lib, "wtsapi32.lib") |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 17 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
| 18 #include "base/logging.h" | 18 #include "base/logging.h" |
| 19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
| 20 #include "base/prefs/pref_service.h" | |
| 21 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 22 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/ui/browser_finder.h" | 23 #include "chrome/browser/ui/browser_finder.h" |
| 25 #include "chrome/browser/ui/browser_list.h" | 24 #include "chrome/browser/ui/browser_list.h" |
| 26 #include "chrome/browser/ui/browser_list_observer.h" | 25 #include "chrome/browser/ui/browser_list_observer.h" |
| 27 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 29 #include "components/pref_registry/pref_registry_syncable.h" | 28 #include "components/pref_registry/pref_registry_syncable.h" |
| 29 #include "components/prefs/pref_service.h" |
| 30 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 // The duration of the silent period before we start nagging the user again. | 34 // The duration of the silent period before we start nagging the user again. |
| 35 const int kSilenceDurationDays = 100; | 35 const int kSilenceDurationDays = 100; |
| 36 | 36 |
| 37 // The number of warnings to be shown on consequtive starts of Chrome before the | 37 // The number of warnings to be shown on consequtive starts of Chrome before the |
| 38 // silent period starts. | 38 // silent period starts. |
| 39 const int kMaxWarnings = 2; | 39 const int kMaxWarnings = 2; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // static | 175 // static |
| 176 void NetworkProfileBubble::NotifyNetworkProfileDetected() { | 176 void NetworkProfileBubble::NotifyNetworkProfileDetected() { |
| 177 Browser* browser = chrome::FindLastActiveWithHostDesktopType( | 177 Browser* browser = chrome::FindLastActiveWithHostDesktopType( |
| 178 chrome::GetActiveDesktop()); | 178 chrome::GetActiveDesktop()); |
| 179 | 179 |
| 180 if (browser) | 180 if (browser) |
| 181 ShowNotification(browser); | 181 ShowNotification(browser); |
| 182 else | 182 else |
| 183 BrowserList::AddObserver(new BrowserListObserver()); | 183 BrowserList::AddObserver(new BrowserListObserver()); |
| 184 } | 184 } |
| OLD | NEW |