OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ |
7 | 7 |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "content/browser/webui/web_ui.h" | 9 #include "content/browser/webui/web_ui.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Callback for "closePromo". | 24 // Callback for "closePromo". |
25 void HandleClosePromo(const ListValue* args); | 25 void HandleClosePromo(const ListValue* args); |
26 | 26 |
27 // Callback for "closeSyncNotification". | 27 // Callback for "closeSyncNotification". |
28 void HandleCloseSyncNotification(const ListValue* args); | 28 void HandleCloseSyncNotification(const ListValue* args); |
29 | 29 |
30 // Callback for "pageSelected". | 30 // Callback for "pageSelected". |
31 void HandlePageSelected(const ListValue* args); | 31 void HandlePageSelected(const ListValue* args); |
32 | 32 |
| 33 // Callback for "navigationDotUsed". This is called when a navigation dot is |
| 34 // clicked, whereas pageSelected might be called after any page-switching user |
| 35 // action. |
| 36 void HandleNavDotUsed(const ListValue* args); |
| 37 |
| 38 // Callback for "handleIntroMessageSeen". No arguments. Called when the intro |
| 39 // message is displayed. |
| 40 void HandleIntroMessageSeen(const ListValue* args); |
| 41 |
33 // Register NTP preferences. | 42 // Register NTP preferences. |
34 static void RegisterUserPrefs(PrefService* prefs); | 43 static void RegisterUserPrefs(PrefService* prefs); |
35 | 44 |
36 // Registers values (strings etc.) for the page. | 45 // Registers values (strings etc.) for the page. |
37 static void GetLocalizedValues(Profile* profile, DictionaryValue* values); | 46 static void GetLocalizedValues(Profile* profile, DictionaryValue* values); |
38 | 47 |
39 private: | 48 private: |
40 // The purpose of this enum is to track which page on the NTP is showing. | 49 // The purpose of this enum is to track which page on the NTP is showing. |
41 // The lower 10 bits of kNTPShownPage are used for the index within the page | 50 // The lower 10 bits of kNTPShownPage are used for the index within the page |
42 // group, and the rest of the bits are used for the page group ID (defined | 51 // group, and the rest of the bits are used for the page group ID (defined |
43 // here). | 52 // here). |
44 enum { | 53 enum { |
45 INDEX_MASK = (1 << 10) - 1, | 54 INDEX_MASK = (1 << 10) - 1, |
46 MOST_VISITED_PAGE_ID = 1 << 10, | 55 MOST_VISITED_PAGE_ID = 1 << 10, |
47 APPS_PAGE_ID = 2 << 10, | 56 APPS_PAGE_ID = 2 << 10, |
48 BOOKMARKS_PAGE_ID = 3 << 10, | 57 BOOKMARKS_PAGE_ID = 3 << 10, |
49 }; | 58 }; |
50 | 59 |
51 DISALLOW_COPY_AND_ASSIGN(NewTabPageHandler); | 60 DISALLOW_COPY_AND_ASSIGN(NewTabPageHandler); |
52 }; | 61 }; |
53 | 62 |
54 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ | 63 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ |
OLD | NEW |