Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / history_ui.h
index df2431a..b94eaa3 100644 (file)
@@ -7,13 +7,14 @@
 
 #include <string>
 
+#include "base/memory/weak_ptr.h"
 #include "base/strings/string16.h"
+#include "base/task/cancelable_task_tracker.h"
 #include "base/timer/timer.h"
 #include "base/values.h"
 #include "chrome/browser/common/cancelable_request.h"
 #include "chrome/browser/history/history_service.h"
 #include "chrome/browser/history/web_history_service.h"
-#include "chrome/common/cancelable_task_tracker.h"
 #include "content/public/browser/notification_registrar.h"
 #include "content/public/browser/web_ui_controller.h"
 #include "content/public/browser/web_ui_message_handler.h"
@@ -157,8 +158,7 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
   void RemoveComplete();
 
   // Callback from history server when visits were deleted.
-  void RemoveWebHistoryComplete(history::WebHistoryService::Request* request,
-                                bool success);
+  void RemoveWebHistoryComplete(bool success);
 
   bool ExtractIntegerValueAtIndex(
       const base::ListValue* value, int index, int* out_int);
@@ -181,12 +181,11 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
   // Deleting the request will cancel it.
   scoped_ptr<history::WebHistoryService::Request> web_history_request_;
 
-  // The currently-executing delete request for synced history.
-  // Deleting the request will cancel it.
-  scoped_ptr<history::WebHistoryService::Request> web_history_delete_request_;
+  // True if there is a pending delete requests to the history service.
+  bool has_pending_delete_request_;
 
   // Tracker for delete requests to the history service.
-  CancelableTaskTracker delete_task_tracker_;
+  base::CancelableTaskTracker delete_task_tracker_;
 
   // The list of URLs that are in the process of being deleted.
   std::set<GURL> urls_to_be_deleted_;
@@ -203,6 +202,8 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
   // Timer used to implement a timeout on a Web History response.
   base::OneShotTimer<BrowsingHistoryHandler> web_history_timer_;
 
+  base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler);
 };