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

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

Issue 10693109: Use Drive v2 API: enable behind --enable-drive-api flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove boolean use_drive_api Created 8 years, 5 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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/bind_helpers.h" 13 #include "base/bind_helpers.h"
14 #include "base/command_line.h"
14 #include "base/file_path.h" 15 #include "base/file_path.h"
15 #include "base/file_util.h" 16 #include "base/file_util.h"
16 #include "base/json/json_reader.h" 17 #include "base/json/json_reader.h"
17 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "base/string_util.h"
18 #include "base/stringprintf.h" 20 #include "base/stringprintf.h"
19 #include "base/string_util.h"
20 #include "base/threading/sequenced_worker_pool.h" 21 #include "base/threading/sequenced_worker_pool.h"
21 #include "chrome/common/chrome_version_info.h"
22 #include "chrome/common/pref_names.h"
23 #include "chrome/common/url_constants.h"
24 #include "chrome/browser/chromeos/gdata/gdata.pb.h" 22 #include "chrome/browser/chromeos/gdata/gdata.pb.h"
25 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" 23 #include "chrome/browser/chromeos/gdata/gdata_file_system.h"
26 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" 24 #include "chrome/browser/chromeos/gdata/gdata_system_service.h"
27 #include "chrome/browser/chromeos/login/user.h" 25 #include "chrome/browser/chromeos/login/user.h"
28 #include "chrome/browser/chromeos/login/user_manager.h" 26 #include "chrome/browser/chromeos/login/user_manager.h"
29 #include "chrome/browser/prefs/pref_service.h" 27 #include "chrome/browser/prefs/pref_service.h"
30 #include "chrome/browser/profiles/profile.h" 28 #include "chrome/browser/profiles/profile.h"
31 #include "chrome/browser/ui/browser.h" 29 #include "chrome/browser/ui/browser.h"
32 #include "chrome/browser/ui/browser_finder.h" 30 #include "chrome/browser/ui/browser_finder.h"
31 #include "chrome/common/chrome_switches.h"
32 #include "chrome/common/chrome_version_info.h"
33 #include "chrome/common/pref_names.h"
34 #include "chrome/common/url_constants.h"
33 #include "content/public/browser/browser_thread.h" 35 #include "content/public/browser/browser_thread.h"
34 #include "content/public/browser/child_process_security_policy.h" 36 #include "content/public/browser/child_process_security_policy.h"
35 #include "net/base/escape.h" 37 #include "net/base/escape.h"
36 #include "third_party/libxml/chromium/libxml_utils.h" 38 #include "third_party/libxml/chromium/libxml_utils.h"
37 39
38 using content::BrowserThread; 40 using content::BrowserThread;
39 41
40 namespace gdata { 42 namespace gdata {
41 namespace util { 43 namespace util {
42 44
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 *resource_id = UnescapeCacheFileName(base_name.value()); 372 *resource_id = UnescapeCacheFileName(base_name.value());
371 373
372 // Assign the extracted extensions to md5 and extra_extension. 374 // Assign the extracted extensions to md5 and extra_extension.
373 int extension_count = extensions.size(); 375 int extension_count = extensions.size();
374 *md5 = (extension_count > 0) ? extensions[extension_count - 1] : 376 *md5 = (extension_count > 0) ? extensions[extension_count - 1] :
375 std::string(); 377 std::string();
376 *extra_extension = (extension_count > 1) ? extensions[extension_count - 2] : 378 *extra_extension = (extension_count > 1) ? extensions[extension_count - 2] :
377 std::string(); 379 std::string();
378 } 380 }
379 381
382 bool IsDriveV2ApiEnabled() {
383 static bool enabled = CommandLine::ForCurrentProcess()->HasSwitch(
384 switches::kEnableDriveV2Api);
385 return enabled;
satorux1 2012/07/10 18:10:33 Would be nice to create a separate patch that just
kochi 2012/07/11 09:43:27 Done. https://chromiumcodereview.appspot.com/1069
386 }
387
380 } // namespace util 388 } // namespace util
381 } // namespace gdata 389 } // namespace gdata
OLDNEW
« chrome/browser/chromeos/gdata/gdata_parser.cc ('K') | « chrome/browser/chromeos/gdata/gdata_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698