OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/download/save_file.h" | 5 #include "chrome/browser/download/save_file.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 bool SaveFile::Open(const char* open_mode) { | 94 bool SaveFile::Open(const char* open_mode) { |
95 DCHECK(!full_path_.empty()); | 95 DCHECK(!full_path_.empty()); |
96 file_ = file_util::OpenFile(full_path_, open_mode); | 96 file_ = file_util::OpenFile(full_path_, open_mode); |
97 if (!file_) { | 97 if (!file_) { |
98 return false; | 98 return false; |
99 } | 99 } |
100 #if defined(OS_WIN) | 100 #if defined(OS_WIN) |
101 // Sets the zone to tell Windows that this file comes from the Internet. | 101 // Sets the zone to tell Windows that this file comes from the Internet. |
102 // We ignore the return value because a failure is not fatal. | 102 // We ignore the return value because a failure is not fatal. |
103 // TODO(port): Similarly mark on Mac. | 103 // TODO(port): Similarly mark on Mac. |
104 win_util::SetInternetZoneIdentifier(full_path_); | 104 win_util::SetInternetZoneIdentifier(FilePath::FromWStringHack(full_path_)); |
105 #endif | 105 #endif |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
OLD | NEW |