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

Unified Diff: chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc

Issue 10803010: Upstream TabAndroid abstract class. (Closed) Base URL: http://git.chromium.org/chromium/src.git@os_compat
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc
diff --git a/chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc b/chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc
index c69250071ce34ca58893ad4a2d3165216717ac9d..41f25889b83cd974d7a249f6971a223fb1dc7229 100644
--- a/chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc
+++ b/chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.cc
@@ -2,20 +2,53 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/ui/android/tab_contents/chrome_web_contents_view_delegate_android.h"
+
#include "base/logging.h"
+#include "chrome/browser/android/tab_android.h"
#include "content/public/browser/web_contents_view_delegate.h"
+#include "content/public/common/context_menu_params.h"
namespace content {
-class WebContents;
+ class ContextMenuParams;
Lei Zhang 2012/07/18 18:07:43 nit: no space in front of "class"
felipeg 2012/07/19 10:15:36 Done.
} // namespace content
+ChromeWebContentsViewDelegateAndroid::ChromeWebContentsViewDelegateAndroid(
+ content::WebContents* web_contents)
+ : web_contents_(web_contents) {
+}
+
+ChromeWebContentsViewDelegateAndroid::~ChromeWebContentsViewDelegateAndroid() {
+}
+
+content::WebDragDestDelegate*
+ChromeWebContentsViewDelegateAndroid::GetDragDestDelegate() {
+ // GetDragDestDelegate is a pure virtual method from WebContentsViewDelegate
+ // and must have an implementation although android doesn't use it.
+ NOTREACHED();
+ return NULL;
+}
+
+void ChromeWebContentsViewDelegateAndroid::ShowContextMenu(
+ const content::ContextMenuParams& params) {
+ // http://crbug.com/136075
+ NOTIMPLEMENTED();
+ // Still lacking some code here that depends on
+ // content/public/browser/android/content_view_core.h
+
+ TabAndroid* tab = TabAndroid::FromWebContents(web_contents_);
+ // We may not have a Tab if we're running in Android WebView mode.
+ // TODO: The long term plan is to factor out the context menu code into
+ // a shared class and have WebView use a separate delegate.
+ if (tab)
+ tab->ShowContextMenu(params);
+}
+
namespace chrome {
content::WebContentsViewDelegate* CreateWebContentsViewDelegate(
content::WebContents* web_contents) {
- // http://crbug.com/136075
- NOTIMPLEMENTED();
- return NULL;
+ return new ChromeWebContentsViewDelegateAndroid(web_contents);
}
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698