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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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
« no previous file with comments | « chrome/browser/ui/metro_pin_tab_helper_win.cc ('k') | chrome/browser/ui/pdf/pdf_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be
2 // found in the LICENSE file. 2 // found in the LICENSE file.
3 3
4 #include "chrome/browser/ui/network_profile_bubble.h" 4 #include "chrome/browser/ui/network_profile_bubble.h"
5 5
6 #include <windows.h> 6 #include <windows.h>
7 7
8 #include <wtsapi32.h> 8 #include <wtsapi32.h>
9 // Make sure we link the wtsapi lib file in. 9 // Make sure we link the wtsapi lib file in.
10 #pragma comment(lib, "wtsapi32.lib") 10 #pragma comment(lib, "wtsapi32.lib")
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 unsigned short* type = reinterpret_cast<unsigned short*>(buffer); 120 unsigned short* type = reinterpret_cast<unsigned short*>(buffer);
121 // We should warn the users if they have their profile on a network share only 121 // We should warn the users if they have their profile on a network share only
122 // if running on a local session. 122 // if running on a local session.
123 if (*type == WTS_PROTOCOL_TYPE_CONSOLE) { 123 if (*type == WTS_PROTOCOL_TYPE_CONSOLE) {
124 bool profile_on_network = false; 124 bool profile_on_network = false;
125 if (!profile_folder.empty()) { 125 if (!profile_folder.empty()) {
126 base::FilePath temp_file; 126 base::FilePath temp_file;
127 // Try to create some non-empty temp file in the profile dir and use 127 // Try to create some non-empty temp file in the profile dir and use
128 // it to check if there is a reparse-point free path to it. 128 // it to check if there is a reparse-point free path to it.
129 if (base::CreateTemporaryFileInDir(profile_folder, &temp_file) && 129 if (base::CreateTemporaryFileInDir(profile_folder, &temp_file) &&
130 (file_util::WriteFile(temp_file, ".", 1) == 1)) { 130 (base::WriteFile(temp_file, ".", 1) == 1)) {
131 base::FilePath normalized_temp_file; 131 base::FilePath normalized_temp_file;
132 if (!base::NormalizeFilePath(temp_file, &normalized_temp_file)) 132 if (!base::NormalizeFilePath(temp_file, &normalized_temp_file))
133 profile_on_network = true; 133 profile_on_network = true;
134 } else { 134 } else {
135 RecordUmaEvent(METRIC_CHECK_IO_FAILED); 135 RecordUmaEvent(METRIC_CHECK_IO_FAILED);
136 } 136 }
137 base::DeleteFile(temp_file, false); 137 base::DeleteFile(temp_file, false);
138 } 138 }
139 if (profile_on_network) { 139 if (profile_on_network) {
140 RecordUmaEvent(METRIC_PROFILE_ON_NETWORK); 140 RecordUmaEvent(METRIC_PROFILE_ON_NETWORK);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // static 178 // static
179 void NetworkProfileBubble::NotifyNetworkProfileDetected() { 179 void NetworkProfileBubble::NotifyNetworkProfileDetected() {
180 Browser* browser = chrome::FindLastActiveWithHostDesktopType( 180 Browser* browser = chrome::FindLastActiveWithHostDesktopType(
181 chrome::GetActiveDesktop()); 181 chrome::GetActiveDesktop());
182 182
183 if (browser) 183 if (browser)
184 ShowNotification(browser); 184 ShowNotification(browser);
185 else 185 else
186 BrowserList::AddObserver(new BrowserListObserver()); 186 BrowserList::AddObserver(new BrowserListObserver());
187 } 187 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/metro_pin_tab_helper_win.cc ('k') | chrome/browser/ui/pdf/pdf_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698