| 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_NTP_RESOURCE_CACHE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 virtual void Observe(int type, | 33 virtual void Observe(int type, |
| 34 const content::NotificationSource& source, | 34 const content::NotificationSource& source, |
| 35 const content::NotificationDetails& details) OVERRIDE; | 35 const content::NotificationDetails& details) OVERRIDE; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 Profile* profile_; | 38 Profile* profile_; |
| 39 | 39 |
| 40 void CreateNewTabHTML(); | 40 void CreateNewTabHTML(); |
| 41 scoped_refptr<RefCountedMemory> new_tab_html_; | 41 scoped_refptr<RefCountedMemory> new_tab_html_; |
| 42 | 42 |
| 43 // Helper to determine if the resource cache should be invalidated. |
| 44 // This is called on every page load, and can be used to check values that |
| 45 // don't generate a notification when changed (e.g., system preferences). |
| 46 bool NewTabCacheNeedsRefresh(); |
| 47 |
| 43 #if !defined(OS_ANDROID) | 48 #if !defined(OS_ANDROID) |
| 44 // Returns a message describing any newly-added sync types, or an empty | 49 // Returns a message describing any newly-added sync types, or an empty |
| 45 // string if all types have already been acknowledged. | 50 // string if all types have already been acknowledged. |
| 46 string16 GetSyncTypeMessage(); | 51 string16 GetSyncTypeMessage(); |
| 47 | 52 |
| 48 void CreateNewTabIncognitoHTML(); | 53 void CreateNewTabIncognitoHTML(); |
| 49 scoped_refptr<RefCountedMemory> new_tab_incognito_html_; | 54 scoped_refptr<RefCountedMemory> new_tab_incognito_html_; |
| 50 | 55 |
| 51 void CreateNewTabIncognitoCSS(); | 56 void CreateNewTabIncognitoCSS(); |
| 52 scoped_refptr<RefCountedMemory> new_tab_incognito_css_; | 57 scoped_refptr<RefCountedMemory> new_tab_incognito_css_; |
| 53 void CreateNewTabCSS(); | 58 void CreateNewTabCSS(); |
| 54 scoped_refptr<RefCountedMemory> new_tab_css_; | 59 scoped_refptr<RefCountedMemory> new_tab_css_; |
| 55 | 60 |
| 56 content::NotificationRegistrar registrar_; | 61 content::NotificationRegistrar registrar_; |
| 57 PrefChangeRegistrar pref_change_registrar_; | 62 PrefChangeRegistrar pref_change_registrar_; |
| 58 #endif | 63 #endif |
| 59 | 64 |
| 65 bool is_swipe_tracking_from_scroll_events_enabled_; |
| 66 |
| 60 DISALLOW_COPY_AND_ASSIGN(NTPResourceCache); | 67 DISALLOW_COPY_AND_ASSIGN(NTPResourceCache); |
| 61 }; | 68 }; |
| 62 | 69 |
| 63 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_H_ | 70 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_H_ |
| OLD | NEW |