| 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 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 web_ui->AddMessageHandler(new NewTabPageSyncHandler()); | 118 web_ui->AddMessageHandler(new NewTabPageSyncHandler()); |
| 119 | 119 |
| 120 // Or apps. | 120 // Or apps. |
| 121 if (ShouldShowApps()) { | 121 if (ShouldShowApps()) { |
| 122 ExtensionService* service = GetProfile()->GetExtensionService(); | 122 ExtensionService* service = GetProfile()->GetExtensionService(); |
| 123 // We might not have an ExtensionService (on ChromeOS when not logged in | 123 // We might not have an ExtensionService (on ChromeOS when not logged in |
| 124 // for example). | 124 // for example). |
| 125 if (service) | 125 if (service) |
| 126 web_ui->AddMessageHandler(new AppLauncherHandler(service)); | 126 web_ui->AddMessageHandler(new AppLauncherHandler(service)); |
| 127 } | 127 } |
| 128 |
| 129 web_ui->AddMessageHandler(new AppsPagePresenceHandler()); |
| 128 #endif | 130 #endif |
| 129 | 131 |
| 130 web_ui->AddMessageHandler(new FaviconWebUIHandler()); | 132 web_ui->AddMessageHandler(new FaviconWebUIHandler()); |
| 131 } | 133 } |
| 132 | 134 |
| 133 #if defined(OS_ANDROID) | 135 #if defined(OS_ANDROID) |
| 134 // These handlers are specific to the Android NTP page. | 136 // These handlers are specific to the Android NTP page. |
| 135 web_ui->AddMessageHandler(new BookmarksHandler()); | 137 web_ui->AddMessageHandler(new BookmarksHandler()); |
| 136 web_ui->AddMessageHandler(new ContextMenuHandler()); | 138 web_ui->AddMessageHandler(new ContextMenuHandler()); |
| 137 web_ui->AddMessageHandler(new NewTabPageReadyHandler()); | 139 web_ui->AddMessageHandler(new NewTabPageReadyHandler()); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, | 425 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, |
| 424 const char* mime_type, | 426 const char* mime_type, |
| 425 int resource_id) { | 427 int resource_id) { |
| 426 DCHECK(resource); | 428 DCHECK(resource); |
| 427 DCHECK(mime_type); | 429 DCHECK(mime_type); |
| 428 resource_map_[std::string(resource)] = | 430 resource_map_[std::string(resource)] = |
| 429 std::make_pair(std::string(mime_type), resource_id); | 431 std::make_pair(std::string(mime_type), resource_id); |
| 430 } | 432 } |
| 431 | 433 |
| 432 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} | 434 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} |
| OLD | NEW |