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. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); | 94 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); |
95 // On Windows notify the users if their profiles are located on a network | 95 // On Windows notify the users if their profiles are located on a network |
96 // share as we don't officially support this setup yet. | 96 // share as we don't officially support this setup yet. |
97 // However we don't want to bother users on Cytrix setups as those have no | 97 // However we don't want to bother users on Cytrix setups as those have no |
98 // real choice and their admins must be well aware of the risks associated. | 98 // real choice and their admins must be well aware of the risks associated. |
99 // Also the command line flag --no-network-profile-warning can stop this | 99 // Also the command line flag --no-network-profile-warning can stop this |
100 // warning from popping up. In this case we can skip the check to make the | 100 // warning from popping up. In this case we can skip the check to make the |
101 // start faster. | 101 // start faster. |
102 // Collect a lot of stats along the way to see which cases do occur in the | 102 // Collect a lot of stats along the way to see which cases do occur in the |
103 // wild often enough. | 103 // wild often enough. |
104 if (CommandLine::ForCurrentProcess()->HasSwitch( | 104 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
105 switches::kNoNetworkProfileWarning)) { | 105 switches::kNoNetworkProfileWarning)) { |
106 RecordUmaEvent(METRIC_CHECK_SUPPRESSED); | 106 RecordUmaEvent(METRIC_CHECK_SUPPRESSED); |
107 return; | 107 return; |
108 } | 108 } |
109 | 109 |
110 LPWSTR buffer = NULL; | 110 LPWSTR buffer = NULL; |
111 DWORD buffer_length = 0; | 111 DWORD buffer_length = 0; |
112 // Checking for RDP is cheaper than checking for a network drive so do this | 112 // Checking for RDP is cheaper than checking for a network drive so do this |
113 // one first. | 113 // one first. |
114 if (!::WTSQuerySessionInformation(WTS_CURRENT_SERVER, WTS_CURRENT_SESSION, | 114 if (!::WTSQuerySessionInformation(WTS_CURRENT_SERVER, WTS_CURRENT_SESSION, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // static | 179 // static |
180 void NetworkProfileBubble::NotifyNetworkProfileDetected() { | 180 void NetworkProfileBubble::NotifyNetworkProfileDetected() { |
181 Browser* browser = chrome::FindLastActiveWithHostDesktopType( | 181 Browser* browser = chrome::FindLastActiveWithHostDesktopType( |
182 chrome::GetActiveDesktop()); | 182 chrome::GetActiveDesktop()); |
183 | 183 |
184 if (browser) | 184 if (browser) |
185 ShowNotification(browser); | 185 ShowNotification(browser); |
186 else | 186 else |
187 BrowserList::AddObserver(new BrowserListObserver()); | 187 BrowserList::AddObserver(new BrowserListObserver()); |
188 } | 188 } |
OLD | NEW |