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> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 if (time_since_last_check.InDays() > kSilenceDurationDays) { | 83 if (time_since_last_check.InDays() > kSilenceDurationDays) { |
84 prefs->SetInteger(prefs::kNetworkProfileWarningsLeft, kMaxWarnings); | 84 prefs->SetInteger(prefs::kNetworkProfileWarningsLeft, kMaxWarnings); |
85 return !notification_shown_; | 85 return !notification_shown_; |
86 } | 86 } |
87 return false; | 87 return false; |
88 } | 88 } |
89 | 89 |
90 // static | 90 // static |
91 void NetworkProfileBubble::CheckNetworkProfile( | 91 void NetworkProfileBubble::CheckNetworkProfile( |
92 const base::FilePath& profile_folder) { | 92 const base::FilePath& profile_folder) { |
93 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); | |
94 // On Windows notify the users if their profiles are located on a network | 93 // On Windows notify the users if their profiles are located on a network |
95 // share as we don't officially support this setup yet. | 94 // share as we don't officially support this setup yet. |
96 // However we don't want to bother users on Cytrix setups as those have no | 95 // However we don't want to bother users on Cytrix setups as those have no |
97 // real choice and their admins must be well aware of the risks associated. | 96 // real choice and their admins must be well aware of the risks associated. |
98 // Also the command line flag --no-network-profile-warning can stop this | 97 // Also the command line flag --no-network-profile-warning can stop this |
99 // warning from popping up. In this case we can skip the check to make the | 98 // warning from popping up. In this case we can skip the check to make the |
100 // start faster. | 99 // start faster. |
101 // Collect a lot of stats along the way to see which cases do occur in the | 100 // Collect a lot of stats along the way to see which cases do occur in the |
102 // wild often enough. | 101 // wild often enough. |
103 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 102 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 171 |
173 // static | 172 // static |
174 void NetworkProfileBubble::NotifyNetworkProfileDetected() { | 173 void NetworkProfileBubble::NotifyNetworkProfileDetected() { |
175 Browser* browser = chrome::FindLastActive(); | 174 Browser* browser = chrome::FindLastActive(); |
176 | 175 |
177 if (browser) | 176 if (browser) |
178 ShowNotification(browser); | 177 ShowNotification(browser); |
179 else | 178 else |
180 BrowserList::AddObserver(new BrowserListObserver()); | 179 BrowserList::AddObserver(new BrowserListObserver()); |
181 } | 180 } |
OLD | NEW |