Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / toolbar / recent_tabs_sub_menu_model.h
index fea3ba9..b1eb408 100644 (file)
@@ -8,11 +8,11 @@
 #include <set>
 
 #include "base/memory/weak_ptr.h"
+#include "base/task/cancelable_task_tracker.h"
 #include "chrome/browser/favicon/favicon_service.h"
 #include "chrome/browser/sessions/tab_restore_service.h"
 #include "chrome/browser/sessions/tab_restore_service_observer.h"
 #include "chrome/browser/sync/glue/synced_session.h"
-#include "chrome/common/cancelable_task_tracker.h"
 #include "ui/base/accelerators/accelerator.h"
 #include "ui/base/models/simple_menu_model.h"
 
@@ -23,7 +23,7 @@ namespace browser_sync {
 class OpenTabsUIDelegate;
 }
 
-namespace chrome {
+namespace favicon_base {
 struct FaviconImageResult;
 }
 
@@ -47,21 +47,24 @@ class RecentTabsSubMenuModel : public ui::SimpleMenuModel,
   static const int kRecentlyClosedHeaderCommandId;
   static const int kDisabledRecentlyClosedHeaderCommandId;
 
+  // Exposed for tests only: return the Command Id for the first entry in the
+  // recently closed window items list.
+  static int GetFirstRecentTabsCommandId();
+
   // If |open_tabs_delegate| is NULL, the default delegate for |browser|'s
   // profile will be used. Testing may require a specific |open_tabs_delegate|.
   RecentTabsSubMenuModel(ui::AcceleratorProvider* accelerator_provider,
                          Browser* browser,
                          browser_sync::OpenTabsUIDelegate* open_tabs_delegate);
-  virtual ~RecentTabsSubMenuModel();
+  ~RecentTabsSubMenuModel() override;
 
   // Overridden from ui::SimpleMenuModel::Delegate:
-  virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
-  virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
-  virtual bool GetAcceleratorForCommandId(
-      int command_id,
-      ui::Accelerator* accelerator) OVERRIDE;
-  virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
-  virtual const gfx::FontList* GetLabelFontListAt(int index) const OVERRIDE;
+  bool IsCommandIdChecked(int command_id) const override;
+  bool IsCommandIdEnabled(int command_id) const override;
+  bool GetAcceleratorForCommandId(int command_id,
+                                  ui::Accelerator* accelerator) override;
+  void ExecuteCommand(int command_id, int event_flags) override;
+  const gfx::FontList* GetLabelFontListAt(int index) const override;
 
   int GetMaxWidthForItemAtIndex(int item_index) const;
   bool GetURLAndTitleForItemAtIndex(int index,
@@ -107,8 +110,9 @@ class RecentTabsSubMenuModel : public ui::SimpleMenuModel,
   // Add the favicon for a local or other devices' tab asynchronously,
   // OnFaviconDataAvailable() will be invoked when the favicon is ready.
   void AddTabFavicon(int command_id, const GURL& url);
-  void OnFaviconDataAvailable(int command_id,
-                              const chrome::FaviconImageResult& image_result);
+  void OnFaviconDataAvailable(
+      int command_id,
+      const favicon_base::FaviconImageResult& image_result);
 
   // Clear all recently closed tabs and windows.
   void ClearLocalEntries();
@@ -126,8 +130,8 @@ class RecentTabsSubMenuModel : public ui::SimpleMenuModel,
   browser_sync::OpenTabsUIDelegate* GetOpenTabsUIDelegate();
 
   // Overridden from TabRestoreServiceObserver:
-  virtual void TabRestoreServiceChanged(TabRestoreService* service) OVERRIDE;
-  virtual void TabRestoreServiceDestroyed(TabRestoreService* service) OVERRIDE;
+  void TabRestoreServiceChanged(TabRestoreService* service) override;
+  void TabRestoreServiceDestroyed(TabRestoreService* service) override;
 
   Browser* browser_;  // Weak.
 
@@ -159,8 +163,8 @@ class RecentTabsSubMenuModel : public ui::SimpleMenuModel,
 
   gfx::Image default_favicon_;
 
-  CancelableTaskTracker local_tab_cancelable_task_tracker_;
-  CancelableTaskTracker other_devices_tab_cancelable_task_tracker_;
+  base::CancelableTaskTracker local_tab_cancelable_task_tracker_;
+  base::CancelableTaskTracker other_devices_tab_cancelable_task_tracker_;
 
   base::WeakPtrFactory<RecentTabsSubMenuModel> weak_ptr_factory_;