| 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 | 8 |
| 9 #include <wtsapi32.h> | 9 #include <wtsapi32.h> |
| 10 // Make sure we link the wtsapi lib file in. | 10 // Make sure we link the wtsapi lib file in. |
| 11 #pragma comment(lib, "wtsapi32.lib") | 11 #pragma comment(lib, "wtsapi32.lib") |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
| 19 #include "base/prefs/pref_service.h" | 19 #include "base/prefs/pref_service.h" |
| 20 #include "base/time.h" | 20 #include "base/time.h" |
| 21 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/prefs/pref_registry_syncable.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" |
| 28 #include "components/user_prefs/pref_registry_syncable.h" |
| 29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 // The duration of the silent period before we start nagging the user again. | 33 // The duration of the silent period before we start nagging the user again. |
| 34 const int kSilenceDurationDays = 100; | 34 const int kSilenceDurationDays = 100; |
| 35 | 35 |
| 36 // The number of warnings to be shown on consequtive starts of Chrome before the | 36 // The number of warnings to be shown on consequtive starts of Chrome before the |
| 37 // silent period starts. | 37 // silent period starts. |
| 38 const int kMaxWarnings = 2; | 38 const int kMaxWarnings = 2; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // static | 176 // static |
| 177 void NetworkProfileBubble::NotifyNetworkProfileDetected() { | 177 void NetworkProfileBubble::NotifyNetworkProfileDetected() { |
| 178 Browser* browser = chrome::FindLastActiveWithHostDesktopType( | 178 Browser* browser = chrome::FindLastActiveWithHostDesktopType( |
| 179 chrome::GetActiveDesktop()); | 179 chrome::GetActiveDesktop()); |
| 180 | 180 |
| 181 if (browser) | 181 if (browser) |
| 182 ShowNotification(browser); | 182 ShowNotification(browser); |
| 183 else | 183 else |
| 184 BrowserList::AddObserver(new BrowserListObserver()); | 184 BrowserList::AddObserver(new BrowserListObserver()); |
| 185 } | 185 } |
| OLD | NEW |