OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/enhanced_bookmarks/bookmark_server_cluster_service.h" | 5 #include "components/enhanced_bookmarks/bookmark_server_cluster_service.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "components/bookmarks/browser/bookmark_model.h" | 12 #include "components/bookmarks/browser/bookmark_model.h" |
13 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h" | 13 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h" |
14 #include "components/enhanced_bookmarks/enhanced_bookmark_utils.h" | 14 #include "components/enhanced_bookmarks/enhanced_bookmark_utils.h" |
15 #include "components/enhanced_bookmarks/pref_names.h" | 15 #include "components/enhanced_bookmarks/pref_names.h" |
16 #include "components/enhanced_bookmarks/proto/cluster.pb.h" | 16 #include "components/enhanced_bookmarks/proto/cluster.pb.h" |
17 #include "components/pref_registry/pref_registry_syncable.h" | 17 #include "components/pref_registry/pref_registry_syncable.h" |
18 #include "components/signin/core/browser/signin_manager.h" | 18 #include "components/signin/core/browser/signin_manager.h" |
19 #include "net/base/url_util.h" | 19 #include "net/base/url_util.h" |
20 #include "net/url_request/url_fetcher.h" | 20 #include "net/url_request/url_fetcher.h" |
21 #include "net/url_request/url_request_context_getter.h" | 21 #include "net/url_request/url_request_context_getter.h" |
22 | 22 |
| 23 using bookmarks::BookmarkNode; |
| 24 |
23 namespace { | 25 namespace { |
24 const char kClusterUrl[] = "https://www.google.com/stars/cluster"; | 26 const char kClusterUrl[] = "https://www.google.com/stars/cluster"; |
25 const int kPrefServiceVersion = 1; | 27 const int kPrefServiceVersion = 1; |
26 const char kPrefServiceVersionKey[] = "version"; | 28 const char kPrefServiceVersionKey[] = "version"; |
27 const char kPrefServiceDataKey[] = "data"; | 29 const char kPrefServiceDataKey[] = "data"; |
28 const char kAuthIdKey[] = "auth_id"; | 30 const char kAuthIdKey[] = "auth_id"; |
29 } // namespace | 31 } // namespace |
30 | 32 |
31 namespace enhanced_bookmarks { | 33 namespace enhanced_bookmarks { |
32 | 34 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 return false; | 321 return false; |
320 stars_ids.push_back(stars_id); | 322 stars_ids.push_back(stars_id); |
321 } | 323 } |
322 output.insert(std::make_pair(key, stars_ids)); | 324 output.insert(std::make_pair(key, stars_ids)); |
323 } | 325 } |
324 out_map->swap(output); | 326 out_map->swap(output); |
325 return true; | 327 return true; |
326 } | 328 } |
327 | 329 |
328 } // namespace enhanced_bookmarks | 330 } // namespace enhanced_bookmarks |
OLD | NEW |