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/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Callback for "bubblePromoViewed". No arguments. | 52 // Callback for "bubblePromoViewed". No arguments. |
53 void HandleBubblePromoViewed(const base::ListValue* args); | 53 void HandleBubblePromoViewed(const base::ListValue* args); |
54 | 54 |
55 // Callback for "bubblePromoLinkClicked". No arguments. | 55 // Callback for "bubblePromoLinkClicked". No arguments. |
56 void HandleBubblePromoLinkClicked(const base::ListValue* args); | 56 void HandleBubblePromoLinkClicked(const base::ListValue* args); |
57 | 57 |
58 // Callback for "pageSelected". | 58 // Callback for "pageSelected". |
59 void HandlePageSelected(const base::ListValue* args); | 59 void HandlePageSelected(const base::ListValue* args); |
60 | 60 |
| 61 // Callback for "logTimeToClick". |
| 62 void HandleLogTimeToClick(const base::ListValue* args); |
| 63 |
61 // Tracks the number of times the user has switches pages (for UMA). | 64 // Tracks the number of times the user has switches pages (for UMA). |
62 size_t page_switch_count_; | 65 size_t page_switch_count_; |
63 | 66 |
64 // The purpose of this enum is to track which page on the NTP is showing. | 67 // The purpose of this enum is to track which page on the NTP is showing. |
65 // The lower 10 bits of kNtpShownPage are used for the index within the page | 68 // The lower 10 bits of kNtpShownPage are used for the index within the page |
66 // group, and the rest of the bits are used for the page group ID (defined | 69 // group, and the rest of the bits are used for the page group ID (defined |
67 // here). | 70 // here). |
68 static const int kPageIdOffset = 10; | 71 static const int kPageIdOffset = 10; |
69 enum { | 72 enum { |
70 INDEX_MASK = (1 << kPageIdOffset) - 1, | 73 INDEX_MASK = (1 << kPageIdOffset) - 1, |
| 74 MOST_VISITED_PAGE_ID = 1 << kPageIdOffset, |
71 APPS_PAGE_ID = 2 << kPageIdOffset, | 75 APPS_PAGE_ID = 2 << kPageIdOffset, |
72 LAST_PAGE_ID = APPS_PAGE_ID, | 76 LAST_PAGE_ID = APPS_PAGE_ID, |
73 }; | 77 }; |
74 static const int kHistogramEnumerationMax = | 78 static const int kHistogramEnumerationMax = |
75 (LAST_PAGE_ID >> kPageIdOffset) + 1; | 79 (LAST_PAGE_ID >> kPageIdOffset) + 1; |
76 | 80 |
77 // Helper to send out promo resource change notification. | 81 // Helper to send out promo resource change notification. |
78 void Notify(chrome::NotificationType notification_type); | 82 void Notify(chrome::NotificationType notification_type); |
79 | 83 |
80 DISALLOW_COPY_AND_ASSIGN(NewTabPageHandler); | 84 DISALLOW_COPY_AND_ASSIGN(NewTabPageHandler); |
81 }; | 85 }; |
82 | 86 |
83 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ | 87 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_PAGE_HANDLER_H_ |
OLD | NEW |