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_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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // The WebUIController used for the New Tab page. | 32 // The WebUIController used for the New Tab page. |
33 class NewTabUI : public content::WebUIController, | 33 class NewTabUI : public content::WebUIController, |
34 public content::WebContentsObserver, | 34 public content::WebContentsObserver, |
35 public content::NotificationObserver { | 35 public content::NotificationObserver { |
36 public: | 36 public: |
37 explicit NewTabUI(content::WebUI* web_ui); | 37 explicit NewTabUI(content::WebUI* web_ui); |
38 virtual ~NewTabUI(); | 38 virtual ~NewTabUI(); |
39 | 39 |
40 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 40 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
41 | 41 |
| 42 // Returns whether or not this browser process might ever need to show apps |
| 43 // on the NTP. With Win8 running in immersive mode, for example, apps are |
| 44 // displayed on a ChromeOS-style apps bar and not on the NTP. In desktop, |
| 45 // however, apps are displayed on the NTP. Since they both share the same |
| 46 // browser process instance, a different decision is necessary for whether |
| 47 // or not to register app message handlers versus whether to show it on NTP. |
| 48 static bool MightShowApps(); |
| 49 |
42 // Returns whether or not to show apps pages. | 50 // Returns whether or not to show apps pages. |
43 static bool ShouldShowApps(); | 51 static bool ShouldShowApps(); |
44 | 52 |
45 // Returns whether or not "Discovery" in the NTP is Enabled. | 53 // Returns whether or not "Discovery" in the NTP is Enabled. |
46 static bool IsDiscoveryInNTPEnabled(); | 54 static bool IsDiscoveryInNTPEnabled(); |
47 | 55 |
48 // Adds "url", "title", and "direction" keys on incoming dictionary, setting | 56 // Adds "url", "title", and "direction" keys on incoming dictionary, setting |
49 // title as the url as a fallback on empty title. | 57 // title as the url as a fallback on empty title. |
50 static void SetUrlTitleAndDirection(base::DictionaryValue* dictionary, | 58 static void SetUrlTitleAndDirection(base::DictionaryValue* dictionary, |
51 const base::string16& title, | 59 const base::string16& title, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 148 |
141 // If the sync promo NTP bubble is being shown. | 149 // If the sync promo NTP bubble is being shown. |
142 bool showing_sync_bubble_; | 150 bool showing_sync_bubble_; |
143 | 151 |
144 PrefChangeRegistrar pref_change_registrar_; | 152 PrefChangeRegistrar pref_change_registrar_; |
145 | 153 |
146 DISALLOW_COPY_AND_ASSIGN(NewTabUI); | 154 DISALLOW_COPY_AND_ASSIGN(NewTabUI); |
147 }; | 155 }; |
148 | 156 |
149 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 157 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
OLD | NEW |