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 25 matching lines...) Expand all Loading... |
36 static void RegisterUserPrefs(PrefService* prefs); | 36 static void RegisterUserPrefs(PrefService* prefs); |
37 static void MigrateUserPrefs(PrefService* prefs, int old_pref_version, | 37 static void MigrateUserPrefs(PrefService* prefs, int old_pref_version, |
38 int new_pref_version); | 38 int new_pref_version); |
39 | 39 |
40 // Whether we should disable the first run notification based on the command | 40 // Whether we should disable the first run notification based on the command |
41 // line switch. | 41 // line switch. |
42 static bool FirstRunDisabled(); | 42 static bool FirstRunDisabled(); |
43 | 43 |
44 // Adds "url", "title", and "direction" keys on incoming dictionary, setting | 44 // Adds "url", "title", and "direction" keys on incoming dictionary, setting |
45 // title as the url as a fallback on empty title. | 45 // title as the url as a fallback on empty title. |
46 static void SetURLTitleAndDirection(DictionaryValue* dictionary, | 46 static void SetURLTitleAndDirection(base::DictionaryValue* dictionary, |
47 const string16& title, | 47 const string16& title, |
48 const GURL& gurl); | 48 const GURL& gurl); |
49 | 49 |
50 // Converts a list of TabRestoreService entries to the JSON format required | 50 // Converts a list of TabRestoreService entries to the JSON format required |
51 // by the NTP and adds them to the given list value. | 51 // by the NTP and adds them to the given list value. |
52 static void AddRecentlyClosedEntries( | 52 static void AddRecentlyClosedEntries( |
53 const TabRestoreService::Entries& entries, | 53 const TabRestoreService::Entries& entries, |
54 ListValue* entry_list_value); | 54 base::ListValue* entry_list_value); |
55 | 55 |
56 // The current preference version. | 56 // The current preference version. |
57 static int current_pref_version() { return current_pref_version_; } | 57 static int current_pref_version() { return current_pref_version_; } |
58 | 58 |
59 class NewTabHTMLSource : public ChromeURLDataManager::DataSource { | 59 class NewTabHTMLSource : public ChromeURLDataManager::DataSource { |
60 public: | 60 public: |
61 explicit NewTabHTMLSource(Profile* profile); | 61 explicit NewTabHTMLSource(Profile* profile); |
62 | 62 |
63 // Called when the network layer has requested a resource underneath | 63 // Called when the network layer has requested a resource underneath |
64 // the path we registered. | 64 // the path we registered. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |