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

Side by Side Diff: ios/chrome/browser/ui/webui/history/browsing_history_handler.h

Issue 2354613002: [Sync] Fix namespaces for the browser_sync component. (Closed)
Patch Set: Address comments. Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_ 5 #ifndef IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_
6 #define IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_ 6 #define IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/scoped_observer.h" 15 #include "base/scoped_observer.h"
16 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
17 #include "base/task/cancelable_task_tracker.h" 17 #include "base/task/cancelable_task_tracker.h"
18 #include "base/timer/timer.h" 18 #include "base/timer/timer.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #include "components/history/core/browser/history_service_observer.h" 20 #include "components/history/core/browser/history_service_observer.h"
21 #include "components/history/core/browser/url_row.h" 21 #include "components/history/core/browser/url_row.h"
22 #include "components/history/core/browser/web_history_service.h" 22 #include "components/history/core/browser/web_history_service.h"
23 #include "ios/web/public/webui/web_ui_ios_message_handler.h" 23 #include "ios/web/public/webui/web_ui_ios_message_handler.h"
24 #include "url/gurl.h" 24 #include "url/gurl.h"
25 25
26 class ProfileSyncService;
27 class SupervisedUserService; 26 class SupervisedUserService;
28 27
29 namespace bookmarks { 28 namespace bookmarks {
30 class BookmarkModel; 29 class BookmarkModel;
31 } 30 } // namespace bookmarks
31
32 namespace browser_sync {
33 class ProfileSyncService;
34 } // namespace browser_sync
32 35
33 namespace history { 36 namespace history {
34 class HistoryService; 37 class HistoryService;
35 struct QueryOptions; 38 struct QueryOptions;
36 class QueryResults; 39 class QueryResults;
37 } 40 } // namespace history
38 41
39 // The handler for Javascript messages related to the "history" view. 42 // The handler for Javascript messages related to the "history" view.
40 class BrowsingHistoryHandler : public web::WebUIIOSMessageHandler, 43 class BrowsingHistoryHandler : public web::WebUIIOSMessageHandler,
41 public history::HistoryServiceObserver { 44 public history::HistoryServiceObserver {
42 public: 45 public:
43 // Represents a history entry to be shown to the user, representing either 46 // Represents a history entry to be shown to the user, representing either
44 // a local or remote visit. A single entry can represent multiple visits, 47 // a local or remote visit. A single entry can represent multiple visits,
45 // since only the most recent visit on a particular day is shown. 48 // since only the most recent visit on a particular day is shown.
46 struct HistoryEntry { 49 struct HistoryEntry {
47 // Values indicating whether an entry represents only local visits, only 50 // Values indicating whether an entry represents only local visits, only
(...skipping 17 matching lines...) Expand all
65 HistoryEntry(); 68 HistoryEntry();
66 virtual ~HistoryEntry(); 69 virtual ~HistoryEntry();
67 70
68 // Formats this entry's URL and title and adds them to |result|. 71 // Formats this entry's URL and title and adds them to |result|.
69 void SetUrlAndTitle(base::DictionaryValue* result) const; 72 void SetUrlAndTitle(base::DictionaryValue* result) const;
70 73
71 // Converts the entry to a DictionaryValue to be owned by the caller. 74 // Converts the entry to a DictionaryValue to be owned by the caller.
72 std::unique_ptr<base::DictionaryValue> ToValue( 75 std::unique_ptr<base::DictionaryValue> ToValue(
73 bookmarks::BookmarkModel* bookmark_model, 76 bookmarks::BookmarkModel* bookmark_model,
74 SupervisedUserService* supervised_user_service, 77 SupervisedUserService* supervised_user_service,
75 const ProfileSyncService* sync_service) const; 78 const browser_sync::ProfileSyncService* sync_service) const;
76 79
77 // Comparison function for sorting HistoryEntries from newest to oldest. 80 // Comparison function for sorting HistoryEntries from newest to oldest.
78 static bool SortByTimeDescending(const HistoryEntry& entry1, 81 static bool SortByTimeDescending(const HistoryEntry& entry1,
79 const HistoryEntry& entry2); 82 const HistoryEntry& entry2);
80 83
81 // The type of visits this entry represents: local, remote, or both. 84 // The type of visits this entry represents: local, remote, or both.
82 EntryType entry_type; 85 EntryType entry_type;
83 86
84 GURL url; 87 GURL url;
85 base::string16 title; // Title of the entry. May be empty. 88 base::string16 title; // Title of the entry. May be empty.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 226
224 // Whether there are other forms of browsing history on the history server. 227 // Whether there are other forms of browsing history on the history server.
225 bool has_other_forms_of_browsing_history_; 228 bool has_other_forms_of_browsing_history_;
226 229
227 base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_; 230 base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_;
228 231
229 DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler); 232 DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler);
230 }; 233 };
231 234
232 #endif // IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_ 235 #endif // IOS_CHROME_BROWSER_UI_WEBUI_HISTORY_BROWSING_HISTORY_HANDLER_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/sync/ios_chrome_sync_client.mm ('k') | ios/chrome/browser/ui/webui/history/browsing_history_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698