| 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 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 4 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
| 5 | 5 |
| 6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 drive::DriveFileError error, | 276 drive::DriveFileError error, |
| 277 scoped_ptr<drive::DriveEntryProto> entry_proto) { | 277 scoped_ptr<drive::DriveEntryProto> entry_proto) { |
| 278 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 278 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 279 | 279 |
| 280 if (entry_proto.get() && !entry_proto->has_file_specific_info()) | 280 if (entry_proto.get() && !entry_proto->has_file_specific_info()) |
| 281 error = drive::DRIVE_FILE_ERROR_NOT_FOUND; | 281 error = drive::DRIVE_FILE_ERROR_NOT_FOUND; |
| 282 | 282 |
| 283 if (error == drive::DRIVE_FILE_OK) { | 283 if (error == drive::DRIVE_FILE_OK) { |
| 284 GURL page_url; | 284 GURL page_url; |
| 285 if (file_type == drive::REGULAR_FILE) { | 285 if (file_type == drive::REGULAR_FILE) { |
| 286 page_url = drive::util::GetFileResourceUrl( | 286 page_url = drive::util::FilePathToDriveURL( |
| 287 entry_proto->resource_id(), | 287 drive::util::ExtractDrivePath(file_path)); |
| 288 entry_proto->base_name()); | |
| 289 } else if (file_type == drive::HOSTED_DOCUMENT) { | 288 } else if (file_type == drive::HOSTED_DOCUMENT) { |
| 290 page_url = GURL(entry_proto->file_specific_info().alternate_url()); | 289 page_url = GURL(entry_proto->file_specific_info().alternate_url()); |
| 291 } else { | 290 } else { |
| 292 NOTREACHED(); | 291 NOTREACHED(); |
| 293 } | 292 } |
| 294 OpenNewTab(page_url, profile); | 293 OpenNewTab(page_url, profile); |
| 295 } else { | 294 } else { |
| 296 ShowWarningMessageBox(profile, file_path); | 295 ShowWarningMessageBox(profile, file_path); |
| 297 } | 296 } |
| 298 } | 297 } |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 for (google_apis::OperationProgressStatusList::const_iterator iter = | 1005 for (google_apis::OperationProgressStatusList::const_iterator iter = |
| 1007 list.begin(); | 1006 list.begin(); |
| 1008 iter != list.end(); ++iter) { | 1007 iter != list.end(); ++iter) { |
| 1009 result_list->Append( | 1008 result_list->Append( |
| 1010 ProgessStatusToDictionaryValue(profile, extension_id, *iter)); | 1009 ProgessStatusToDictionaryValue(profile, extension_id, *iter)); |
| 1011 } | 1010 } |
| 1012 return result_list.release(); | 1011 return result_list.release(); |
| 1013 } | 1012 } |
| 1014 | 1013 |
| 1015 } // namespace file_manager_util | 1014 } // namespace file_manager_util |
| OLD | NEW |