| 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_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Pointer back to the original profile. | 83 // Pointer back to the original profile. |
| 84 Profile* profile_; | 84 Profile* profile_; |
| 85 | 85 |
| 86 DISALLOW_COPY_AND_ASSIGN(NewTabHTMLSource); | 86 DISALLOW_COPY_AND_ASSIGN(NewTabHTMLSource); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 FRIEND_TEST_ALL_PREFIXES(NewTabUITest, UpdateUserPrefsVersion); | 90 FRIEND_TEST_ALL_PREFIXES(NewTabUITest, UpdateUserPrefsVersion); |
| 91 | 91 |
| 92 virtual void Observe(NotificationType type, | 92 virtual void Observe(int type, |
| 93 const NotificationSource& source, | 93 const NotificationSource& source, |
| 94 const NotificationDetails& details); | 94 const NotificationDetails& details); |
| 95 | 95 |
| 96 // Reset the CSS caches. | 96 // Reset the CSS caches. |
| 97 void InitializeCSSCaches(); | 97 void InitializeCSSCaches(); |
| 98 | 98 |
| 99 void StartTimingPaint(RenderViewHost* render_view_host); | 99 void StartTimingPaint(RenderViewHost* render_view_host); |
| 100 void PaintTimeout(); | 100 void PaintTimeout(); |
| 101 | 101 |
| 102 // Updates the user prefs version and calls |MigrateUserPrefs| if needed. | 102 // Updates the user prefs version and calls |MigrateUserPrefs| if needed. |
| 103 // Returns true if the version was updated. | 103 // Returns true if the version was updated. |
| 104 static bool UpdateUserPrefsVersion(PrefService* prefs); | 104 static bool UpdateUserPrefsVersion(PrefService* prefs); |
| 105 | 105 |
| 106 NotificationRegistrar registrar_; | 106 NotificationRegistrar registrar_; |
| 107 | 107 |
| 108 // The time when we started benchmarking. | 108 // The time when we started benchmarking. |
| 109 base::TimeTicks start_; | 109 base::TimeTicks start_; |
| 110 // The last time we got a paint notification. | 110 // The last time we got a paint notification. |
| 111 base::TimeTicks last_paint_; | 111 base::TimeTicks last_paint_; |
| 112 // Scoping so we can be sure our timeouts don't outlive us. | 112 // Scoping so we can be sure our timeouts don't outlive us. |
| 113 base::OneShotTimer<NewTabUI> timer_; | 113 base::OneShotTimer<NewTabUI> timer_; |
| 114 // The preference version. This used for migrating prefs of the NTP. | 114 // The preference version. This used for migrating prefs of the NTP. |
| 115 static const int current_pref_version_ = 3; | 115 static const int current_pref_version_ = 3; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(NewTabUI); | 117 DISALLOW_COPY_AND_ASSIGN(NewTabUI); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 120 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
| OLD | NEW |