Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 10861042: Add Android's context menu handler used on the NTP. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Resolve Evan's comments. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/ntp/android/context_menu_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "ui/base/layout.h" 54 #include "ui/base/layout.h"
55 #include "ui/base/resource/resource_bundle.h" 55 #include "ui/base/resource/resource_bundle.h"
56 56
57 #if !defined(OS_ANDROID) 57 #if !defined(OS_ANDROID)
58 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" 58 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
59 #include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h" 59 #include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h"
60 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" 60 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h"
61 #include "chrome/browser/ui/webui/ntp/suggestions_page_handler.h" 61 #include "chrome/browser/ui/webui/ntp/suggestions_page_handler.h"
62 #else 62 #else
63 #include "chrome/browser/ui/webui/ntp/android/bookmarks_handler.h" 63 #include "chrome/browser/ui/webui/ntp/android/bookmarks_handler.h"
64 #include "chrome/browser/ui/webui/ntp/android/context_menu_handler.h"
64 #endif 65 #endif
65 66
66 using content::BrowserThread; 67 using content::BrowserThread;
67 using content::RenderViewHost; 68 using content::RenderViewHost;
68 using content::UserMetricsAction; 69 using content::UserMetricsAction;
69 using content::WebContents; 70 using content::WebContents;
70 using content::WebUIController; 71 using content::WebUIController;
71 72
72 namespace { 73 namespace {
73 74
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 126 }
126 #endif 127 #endif
127 128
128 web_ui->AddMessageHandler(new NewTabPageHandler()); 129 web_ui->AddMessageHandler(new NewTabPageHandler());
129 web_ui->AddMessageHandler(new FaviconWebUIHandler()); 130 web_ui->AddMessageHandler(new FaviconWebUIHandler());
130 } 131 }
131 132
132 #if defined(OS_ANDROID) 133 #if defined(OS_ANDROID)
133 // These handlers are specific to the Android NTP page. 134 // These handlers are specific to the Android NTP page.
134 web_ui->AddMessageHandler((new BookmarksHandler())); 135 web_ui->AddMessageHandler((new BookmarksHandler()));
136 web_ui->AddMessageHandler((new ContextMenuHandler()));
135 #else 137 #else
136 // Android uses native UI for sync setup. 138 // Android uses native UI for sync setup.
137 if (NTPLoginHandler::ShouldShow(GetProfile())) 139 if (NTPLoginHandler::ShouldShow(GetProfile()))
138 web_ui->AddMessageHandler(new NTPLoginHandler()); 140 web_ui->AddMessageHandler(new NTPLoginHandler());
139 #endif 141 #endif
140 142
141 // Initializing the CSS and HTML can require some CPU, so do it after 143 // Initializing the CSS and HTML can require some CPU, so do it after
142 // we've hooked up the most visited handler. This allows the DB query 144 // we've hooked up the most visited handler. This allows the DB query
143 // for the new tab thumbs to happen earlier. 145 // for the new tab thumbs to happen earlier.
144 InitializeCSSCaches(); 146 InitializeCSSCaches();
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, 402 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource,
401 const char* mime_type, 403 const char* mime_type,
402 int resource_id) { 404 int resource_id) {
403 DCHECK(resource); 405 DCHECK(resource);
404 DCHECK(mime_type); 406 DCHECK(mime_type);
405 resource_map_[std::string(resource)] = 407 resource_map_[std::string(resource)] =
406 std::make_pair(std::string(mime_type), resource_id); 408 std::make_pair(std::string(mime_type), resource_id);
407 } 409 }
408 410
409 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} 411 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {}
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/android/context_menu_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698