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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // Try to create some non-empty temp file in the profile dir and use | 128 // Try to create some non-empty temp file in the profile dir and use |
129 // it to check if there is a reparse-point free path to it. | 129 // it to check if there is a reparse-point free path to it. |
130 if (file_util::CreateTemporaryFileInDir(profile_folder, &temp_file) && | 130 if (file_util::CreateTemporaryFileInDir(profile_folder, &temp_file) && |
131 file_util::WriteFile(temp_file, ".", 1)) { | 131 file_util::WriteFile(temp_file, ".", 1)) { |
132 base::FilePath normalized_temp_file; | 132 base::FilePath normalized_temp_file; |
133 if (!file_util::NormalizeFilePath(temp_file, &normalized_temp_file)) | 133 if (!file_util::NormalizeFilePath(temp_file, &normalized_temp_file)) |
134 profile_on_network = true; | 134 profile_on_network = true; |
135 } else { | 135 } else { |
136 RecordUmaEvent(METRIC_CHECK_IO_FAILED); | 136 RecordUmaEvent(METRIC_CHECK_IO_FAILED); |
137 } | 137 } |
138 base::Delete(temp_file, false); | 138 base::DeleteFile(temp_file, false); |
139 } | 139 } |
140 if (profile_on_network) { | 140 if (profile_on_network) { |
141 RecordUmaEvent(METRIC_PROFILE_ON_NETWORK); | 141 RecordUmaEvent(METRIC_PROFILE_ON_NETWORK); |
142 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 142 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
143 base::Bind(&NotifyNetworkProfileDetected)); | 143 base::Bind(&NotifyNetworkProfileDetected)); |
144 } else { | 144 } else { |
145 RecordUmaEvent(METRIC_PROFILE_NOT_ON_NETWORK); | 145 RecordUmaEvent(METRIC_PROFILE_NOT_ON_NETWORK); |
146 } | 146 } |
147 } else { | 147 } else { |
148 RecordUmaEvent(METRIC_REMOTE_SESSION); | 148 RecordUmaEvent(METRIC_REMOTE_SESSION); |
(...skipping 30 matching lines...) Expand all 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 |