OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/common/chrome_notification_types.h" | 9 #include "chrome/common/chrome_notification_types.h" |
10 #include "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // The purpose of this enum is to track which page on the NTP is showing. | 58 // The purpose of this enum is to track which page on the NTP is showing. |
59 // The lower 10 bits of kNtpShownPage are used for the index within the page | 59 // The lower 10 bits of kNtpShownPage are used for the index within the page |
60 // group, and the rest of the bits are used for the page group ID (defined | 60 // group, and the rest of the bits are used for the page group ID (defined |
61 // here). | 61 // here). |
62 static const int kPageIdOffset = 10; | 62 static const int kPageIdOffset = 10; |
63 enum { | 63 enum { |
64 INDEX_MASK = (1 << kPageIdOffset) - 1, | 64 INDEX_MASK = (1 << kPageIdOffset) - 1, |
65 MOST_VISITED_PAGE_ID = 1 << kPageIdOffset, | 65 MOST_VISITED_PAGE_ID = 1 << kPageIdOffset, |
66 APPS_PAGE_ID = 2 << kPageIdOffset, | 66 APPS_PAGE_ID = 2 << kPageIdOffset, |
67 BOOKMARKS_PAGE_ID = 3 << kPageIdOffset, | 67 BOOKMARKS_PAGE_ID = 3 << kPageIdOffset, |
68 LAST_PAGE_ID = BOOKMARKS_PAGE_ID | 68 SUGGESTIONS_PAGE_ID = 4 << kPageIdOffset, |
| 69 LAST_PAGE_ID = SUGGESTIONS_PAGE_ID |
69 }; | 70 }; |
70 static const int kHistogramEnumerationMax = | 71 static const int kHistogramEnumerationMax = |
71 (LAST_PAGE_ID >> kPageIdOffset) + 1; | 72 (LAST_PAGE_ID >> kPageIdOffset) + 1; |
72 | 73 |
73 // Helper to send out promo resource change notification. | 74 // Helper to send out promo resource change notification. |
74 void Notify(chrome::NotificationType notification_type); | 75 void Notify(chrome::NotificationType notification_type); |
75 | 76 |
76 DISALLOW_COPY_AND_ASSIGN(NewTabPageHandler); | 77 DISALLOW_COPY_AND_ASSIGN(NewTabPageHandler); |
77 }; | 78 }; |
78 | 79 |
79 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ | 80 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ |
OLD | NEW |