| 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 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 explicit NTPResourceCache(Profile* profile); | 39 explicit NTPResourceCache(Profile* profile); |
| 40 ~NTPResourceCache() override; | 40 ~NTPResourceCache() override; |
| 41 | 41 |
| 42 base::RefCountedMemory* GetNewTabHTML(WindowType win_type); | 42 base::RefCountedMemory* GetNewTabHTML(WindowType win_type); |
| 43 base::RefCountedMemory* GetNewTabCSS(WindowType win_type); | 43 base::RefCountedMemory* GetNewTabCSS(WindowType win_type); |
| 44 | 44 |
| 45 void set_should_show_apps_page(bool should_show_apps_page) { | 45 void set_should_show_apps_page(bool should_show_apps_page) { |
| 46 should_show_apps_page_ = should_show_apps_page; | 46 should_show_apps_page_ = should_show_apps_page; |
| 47 } | 47 } |
| 48 void set_should_show_most_visited_page(bool should_show_most_visited_page) { | |
| 49 should_show_most_visited_page_ = should_show_most_visited_page; | |
| 50 } | |
| 51 void set_should_show_other_devices_menu(bool should_show_other_devices_menu) { | 48 void set_should_show_other_devices_menu(bool should_show_other_devices_menu) { |
| 52 should_show_other_devices_menu_ = should_show_other_devices_menu; | 49 should_show_other_devices_menu_ = should_show_other_devices_menu; |
| 53 } | 50 } |
| 54 // content::NotificationObserver interface. | 51 // content::NotificationObserver interface. |
| 55 void Observe(int type, | 52 void Observe(int type, |
| 56 const content::NotificationSource& source, | 53 const content::NotificationSource& source, |
| 57 const content::NotificationDetails& details) override; | 54 const content::NotificationDetails& details) override; |
| 58 | 55 |
| 59 static WindowType GetWindowType( | 56 static WindowType GetWindowType( |
| 60 Profile* profile, content::RenderProcessHost* render_host); | 57 Profile* profile, content::RenderProcessHost* render_host); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 content::NotificationRegistrar registrar_; | 93 content::NotificationRegistrar registrar_; |
| 97 PrefChangeRegistrar profile_pref_change_registrar_; | 94 PrefChangeRegistrar profile_pref_change_registrar_; |
| 98 PrefChangeRegistrar local_state_pref_change_registrar_; | 95 PrefChangeRegistrar local_state_pref_change_registrar_; |
| 99 scoped_ptr<PromoResourceService::StateChangedSubscription> | 96 scoped_ptr<PromoResourceService::StateChangedSubscription> |
| 100 promo_resource_subscription_; | 97 promo_resource_subscription_; |
| 101 | 98 |
| 102 // Set based on platform_util::IsSwipeTrackingFromScrollEventsEnabled. | 99 // Set based on platform_util::IsSwipeTrackingFromScrollEventsEnabled. |
| 103 bool is_swipe_tracking_from_scroll_events_enabled_; | 100 bool is_swipe_tracking_from_scroll_events_enabled_; |
| 104 // Set based on NewTabUI::ShouldShowApps. | 101 // Set based on NewTabUI::ShouldShowApps. |
| 105 bool should_show_apps_page_; | 102 bool should_show_apps_page_; |
| 106 // The next three all default to true and can be manually set, e.g., by the | |
| 107 // chrome://apps page. | |
| 108 bool should_show_most_visited_page_; | |
| 109 bool should_show_other_devices_menu_; | 103 bool should_show_other_devices_menu_; |
| 110 | 104 |
| 111 DISALLOW_COPY_AND_ASSIGN(NTPResourceCache); | 105 DISALLOW_COPY_AND_ASSIGN(NTPResourceCache); |
| 112 }; | 106 }; |
| 113 | 107 |
| 114 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_H_ | 108 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_H_ |
| OLD | NEW |