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 | 4 |
5 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
15 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
| 16 #include "base/values.h" |
16 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h" | 17 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h" |
17 #include "chrome/browser/chromeos/gdata/drive_api_parser.h" | 18 #include "chrome/browser/chromeos/gdata/drive_api_parser.h" |
18 #include "chrome/browser/chromeos/gdata/gdata_cache.h" | 19 #include "chrome/browser/chromeos/gdata/gdata_cache.h" |
19 #include "chrome/browser/chromeos/gdata/gdata_documents_service.h" | 20 #include "chrome/browser/chromeos/gdata/gdata_documents_service.h" |
20 #include "chrome/browser/chromeos/gdata/gdata_util.h" | 21 #include "chrome/browser/chromeos/gdata/gdata_util.h" |
21 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.h" | 22 #include "chrome/browser/chromeos/gdata/gdata_wapi_feed_processor.h" |
22 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
23 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
24 | 25 |
25 using content::BrowserThread; | 26 using content::BrowserThread; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 131 } |
131 } | 132 } |
132 | 133 |
133 bool UseLevelDB() { | 134 bool UseLevelDB() { |
134 return CommandLine::ForCurrentProcess()->HasSwitch( | 135 return CommandLine::ForCurrentProcess()->HasSwitch( |
135 switches::kUseLevelDBForGData); | 136 switches::kUseLevelDBForGData); |
136 } | 137 } |
137 | 138 |
138 } // namespace | 139 } // namespace |
139 | 140 |
| 141 LoadRootFeedParams::LoadRootFeedParams( |
| 142 FilePath search_file_path, |
| 143 bool should_load_from_server, |
| 144 const FindEntryCallback& callback) |
| 145 : search_file_path(search_file_path), |
| 146 should_load_from_server(should_load_from_server), |
| 147 load_error(GDATA_FILE_OK), |
| 148 load_start_time(base::Time::Now()), |
| 149 callback(callback) { |
| 150 } |
| 151 |
| 152 LoadRootFeedParams::~LoadRootFeedParams() { |
| 153 } |
| 154 |
140 GetDocumentsParams::GetDocumentsParams( | 155 GetDocumentsParams::GetDocumentsParams( |
141 int64 start_changestamp, | 156 int64 start_changestamp, |
142 int64 root_feed_changestamp, | 157 int64 root_feed_changestamp, |
143 std::vector<DocumentFeed*>* feed_list, | 158 std::vector<DocumentFeed*>* feed_list, |
144 bool should_fetch_multiple_feeds, | 159 bool should_fetch_multiple_feeds, |
145 const FilePath& search_file_path, | 160 const FilePath& search_file_path, |
146 const std::string& search_query, | 161 const std::string& search_query, |
147 const std::string& directory_resource_id, | 162 const std::string& directory_resource_id, |
148 const FindEntryCallback& callback, | 163 const FindEntryCallback& callback, |
149 GetDocumentsUiState* ui_state) | 164 GetDocumentsUiState* ui_state) |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 dir_iter != changed_dirs.end(); ++dir_iter) { | 821 dir_iter != changed_dirs.end(); ++dir_iter) { |
807 FOR_EACH_OBSERVER(Observer, observers_, | 822 FOR_EACH_OBSERVER(Observer, observers_, |
808 OnDirectoryChanged(*dir_iter)); | 823 OnDirectoryChanged(*dir_iter)); |
809 } | 824 } |
810 } | 825 } |
811 | 826 |
812 return error; | 827 return error; |
813 } | 828 } |
814 | 829 |
815 } // namespace gdata | 830 } // namespace gdata |
OLD | NEW |