Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: chrome/browser/ui/network_profile_bubble.cc

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 unsigned short* type = reinterpret_cast<unsigned short*>(buffer); 121 unsigned short* type = reinterpret_cast<unsigned short*>(buffer);
122 // We should warn the users if they have their profile on a network share only 122 // We should warn the users if they have their profile on a network share only
123 // if running on a local session. 123 // if running on a local session.
124 if (*type == WTS_PROTOCOL_TYPE_CONSOLE) { 124 if (*type == WTS_PROTOCOL_TYPE_CONSOLE) {
125 bool profile_on_network = false; 125 bool profile_on_network = false;
126 if (!profile_folder.empty()) { 126 if (!profile_folder.empty()) {
127 base::FilePath temp_file; 127 base::FilePath temp_file;
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 (base::CreateTemporaryFileInDir(profile_folder, &temp_file) &&
131 (file_util::WriteFile(temp_file, ".", 1) == 1)) { 131 (file_util::WriteFile(temp_file, ".", 1) == 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::DeleteFile(temp_file, false); 138 base::DeleteFile(temp_file, false);
139 } 139 }
140 if (profile_on_network) { 140 if (profile_on_network) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtk2ui/app_indicator_icon.cc ('k') | chrome/browser/ui/pdf/pdf_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698