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 29 matching lines...) Expand all Loading... |
40 // Adds "url", "title", and "direction" keys on incoming dictionary, setting | 40 // Adds "url", "title", and "direction" keys on incoming dictionary, setting |
41 // title as the url as a fallback on empty title. | 41 // title as the url as a fallback on empty title. |
42 static void SetURLTitleAndDirection(base::DictionaryValue* dictionary, | 42 static void SetURLTitleAndDirection(base::DictionaryValue* dictionary, |
43 const string16& title, | 43 const string16& title, |
44 const GURL& gurl); | 44 const GURL& gurl); |
45 | 45 |
46 // The current preference version. | 46 // The current preference version. |
47 static int current_pref_version() { return current_pref_version_; } | 47 static int current_pref_version() { return current_pref_version_; } |
48 | 48 |
49 // Returns whether NTP4 is enabled. | 49 // Returns whether NTP4 is enabled. |
50 static bool Ntp4Enabled(); | 50 static bool NTP4Enabled(); |
51 | 51 |
52 class NewTabHTMLSource : public ChromeURLDataManager::DataSource { | 52 class NewTabHTMLSource : public ChromeURLDataManager::DataSource { |
53 public: | 53 public: |
54 explicit NewTabHTMLSource(Profile* profile); | 54 explicit NewTabHTMLSource(Profile* profile); |
55 | 55 |
56 // Called when the network layer has requested a resource underneath | 56 // Called when the network layer has requested a resource underneath |
57 // the path we registered. | 57 // the path we registered. |
58 virtual void StartDataRequest(const std::string& path, | 58 virtual void StartDataRequest(const std::string& path, |
59 bool is_incognito, | 59 bool is_incognito, |
60 int request_id) OVERRIDE; | 60 int request_id) OVERRIDE; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 base::TimeTicks last_paint_; | 97 base::TimeTicks last_paint_; |
98 // Scoping so we can be sure our timeouts don't outlive us. | 98 // Scoping so we can be sure our timeouts don't outlive us. |
99 base::OneShotTimer<NewTabUI> timer_; | 99 base::OneShotTimer<NewTabUI> timer_; |
100 // The preference version. This used for migrating prefs of the NTP. | 100 // The preference version. This used for migrating prefs of the NTP. |
101 static const int current_pref_version_ = 3; | 101 static const int current_pref_version_ = 3; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(NewTabUI); | 103 DISALLOW_COPY_AND_ASSIGN(NewTabUI); |
104 }; | 104 }; |
105 | 105 |
106 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 106 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
OLD | NEW |