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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_util.cc

Issue 10827068: gdata: Fix "save as pdf" to work on Google Drive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add mock method. Created 8 years, 4 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
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/chromeos/gdata/gdata_util.h" 5 #include "chrome/browser/chromeos/gdata/gdata_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 572
573 std::string FormatTimeAsString(const base::Time& time) { 573 std::string FormatTimeAsString(const base::Time& time) {
574 base::Time::Exploded exploded; 574 base::Time::Exploded exploded;
575 time.UTCExplode(&exploded); 575 time.UTCExplode(&exploded);
576 return base::StringPrintf( 576 return base::StringPrintf(
577 "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", 577 "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ",
578 exploded.year, exploded.month, exploded.day_of_month, 578 exploded.year, exploded.month, exploded.day_of_month,
579 exploded.hour, exploded.minute, exploded.second, exploded.millisecond); 579 exploded.hour, exploded.minute, exploded.second, exploded.millisecond);
580 } 580 }
581 581
582 void PrepareWritableFileAndRun(Profile* profile,
583 const FilePath& path,
584 const OpenFileCallback& callback) {
585 if (IsUnderGDataMountPoint(path)) {
586 FilePath remote_path(ExtractGDataPath(path));
587 GetGDataFileSystem(profile)->PrepareWritableFileAndRun(remote_path,
588 callback);
589 } else {
590 if (!callback.is_null()) {
591 content::BrowserThread::GetBlockingPool()->PostTask(
592 FROM_HERE, base::Bind(callback, GDATA_FILE_OK, path));
593 }
594 }
595 }
596
582 } // namespace util 597 } // namespace util
583 } // namespace gdata 598 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698