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

Side by Side Diff: chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h

Issue 1130753007: Start axing NTP4 dead code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: estade@ review Created 5 years, 7 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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_RECENTLY_CLOSED_TABS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_NTP_RECENTLY_CLOSED_TABS_HANDLER_H_
7
8 #include "base/values.h"
9 #include "chrome/browser/sessions/tab_restore_service.h"
10 #include "chrome/browser/sessions/tab_restore_service_observer.h"
11 #include "content/public/browser/web_ui_message_handler.h"
12
13 class TabRestoreService;
14
15 class RecentlyClosedTabsHandler : public content::WebUIMessageHandler,
16 public TabRestoreServiceObserver {
17 public:
18 RecentlyClosedTabsHandler() : tab_restore_service_(NULL) {}
19 ~RecentlyClosedTabsHandler() override;
20
21 // WebUIMessageHandler implementation.
22 void RegisterMessages() override;
23
24 // Callback for the "reopenTab" message. Rewrites the history of the
25 // currently displayed tab to be the one in TabRestoreService with a
26 // history of a session passed in through the content pointer.
27 void HandleReopenTab(const base::ListValue* args);
28
29 // Callback for the "getRecentlyClosedTabs" message.
30 void HandleGetRecentlyClosedTabs(const base::ListValue* args);
31
32 // Callback for the "clearRecentlyClosed" message.
33 void HandleClearRecentlyClosed(const base::ListValue* args);
34
35 // Observer callback for TabRestoreServiceObserver. Sends data on
36 // recently closed tabs to the javascript side of this page to
37 // display to the user.
38 void TabRestoreServiceChanged(TabRestoreService* service) override;
39
40 // Observer callback to notice when our associated TabRestoreService
41 // is destroyed.
42 void TabRestoreServiceDestroyed(TabRestoreService* service) override;
43
44 private:
45 // Construct and initialize tab_restore_service_ if it's NULL.
46 // tab_restore_service_ may still be NULL, however, in incognito mode.
47 void EnsureTabRestoreService();
48
49 // TabRestoreService that we are observing.
50 TabRestoreService* tab_restore_service_;
51
52 DISALLOW_COPY_AND_ASSIGN(RecentlyClosedTabsHandler);
53 };
54
55 #endif // CHROME_BROWSER_UI_WEBUI_NTP_RECENTLY_CLOSED_TABS_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.cc ('k') | chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698