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

Side by Side Diff: chrome/browser/google_apis/gdata_wapi_parser.cc

Issue 10920091: Move Drive API files to google_apis directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable some tests Created 8 years, 3 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_wapi_parser.h" 5 #include "chrome/browser/google_apis/gdata_wapi_parser.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/json/json_value_converter.h" 11 #include "base/json/json_value_converter.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/string_piece.h" 14 #include "base/string_piece.h"
15 #include "base/string_util.h" 15 #include "base/string_util.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "chrome/browser/chromeos/gdata/drive_api_parser.h" 18 #include "chrome/browser/google_apis/drive_api_parser.h"
19 #include "chrome/browser/chromeos/gdata/gdata_util.h" 19 #include "chrome/browser/google_apis/gdata_util.h"
20 #include "third_party/libxml/chromium/libxml_utils.h" 20 #include "third_party/libxml/chromium/libxml_utils.h"
21 21
22 using base::Value; 22 using base::Value;
23 using base::DictionaryValue; 23 using base::DictionaryValue;
24 using base::ListValue; 24 using base::ListValue;
25 25
26 namespace gdata { 26 namespace gdata {
27 27
28 namespace { 28 namespace {
29 29
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 return std::string(kEntryKindMap[i].extension); 642 return std::string(kEntryKindMap[i].extension);
643 else 643 else
644 return std::string(); 644 return std::string();
645 } 645 }
646 } 646 }
647 return std::string(); 647 return std::string();
648 } 648 }
649 649
650 // static 650 // static
651 bool DocumentEntry::HasHostedDocumentExtension(const FilePath& file) { 651 bool DocumentEntry::HasHostedDocumentExtension(const FilePath& file) {
652 FilePath::StringType file_extension = file.Extension(); 652 #if defined(OS_WIN)
653 std::string file_extension = WideToUTF8(file.Extension());
654 #else
655 std::string file_extension = file.Extension();
656 #endif
653 for (size_t i = 0; i < arraysize(kEntryKindMap); ++i) { 657 for (size_t i = 0; i < arraysize(kEntryKindMap); ++i) {
654 const char* document_extension = kEntryKindMap[i].extension; 658 const char* document_extension = kEntryKindMap[i].extension;
659
655 if (document_extension && file_extension == document_extension) 660 if (document_extension && file_extension == document_extension)
656 return true; 661 return true;
657 } 662 }
658 return false; 663 return false;
659 } 664 }
660 665
661 // static 666 // static
662 DriveEntryKind DocumentEntry::GetEntryKindFromTerm( 667 DriveEntryKind DocumentEntry::GetEntryKindFromTerm(
663 const std::string& term) { 668 const std::string& term) {
664 if (!StartsWithASCII(term, kTermPrefix, false)) { 669 if (!StartsWithASCII(term, kTermPrefix, false)) {
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 bool AccountMetadataFeed::Parse(const base::Value& value) { 1167 bool AccountMetadataFeed::Parse(const base::Value& value) {
1163 base::JSONValueConverter<AccountMetadataFeed> converter; 1168 base::JSONValueConverter<AccountMetadataFeed> converter;
1164 if (!converter.Convert(value, this)) { 1169 if (!converter.Convert(value, this)) {
1165 LOG(ERROR) << "Unable to parse: Invalid account metadata feed!"; 1170 LOG(ERROR) << "Unable to parse: Invalid account metadata feed!";
1166 return false; 1171 return false;
1167 } 1172 }
1168 return true; 1173 return true;
1169 } 1174 }
1170 1175
1171 } // namespace gdata 1176 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698