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

Unified Diff: chrome/browser/android/document/document_web_contents_delegate.h

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? Created 5 years, 7 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/android/document/document_web_contents_delegate.h
diff --git a/chrome/browser/android/document/document_web_contents_delegate.h b/chrome/browser/android/document/document_web_contents_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..47abf8195cdf81330e088aa0770ca02e3b5eeb96
--- /dev/null
+++ b/chrome/browser/android/document/document_web_contents_delegate.h
@@ -0,0 +1,48 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_DOCUMENT_DOCUMENT_WEB_CONTENTS_DELEGATE_H_
+#define CHROME_BROWSER_ANDROID_DOCUMENT_DOCUMENT_WEB_CONTENTS_DELEGATE_H_
+
+#include "components/web_contents_delegate_android/web_contents_delegate_android.h"
+
+// Stub WebContentsDelegateAndroid that is meant to be a temporary substitute
+// for a real WebContentsDelegate for the (expectedly short) period between when
+// a new WebContents is created and the new DocumentActivity/DocumentTab are
+// created and take ownership of the WebContents (which replaces this Delegate
+// with a real one). It is not meant to do anything except allow
+// WebContentsDelegateAndroid::OpenURLFromTab() to load the URL for the
+// WebContents.
+class DocumentWebContentsDelegate
+ : public web_contents_delegate_android::WebContentsDelegateAndroid {
+ public:
+ DocumentWebContentsDelegate(JNIEnv* env, jobject obj);
+ ~DocumentWebContentsDelegate() override;
+
+ // Attaches this delegate to the given WebContents.
+ void AttachContents(JNIEnv* env, jobject obj, jobject jweb_contents);
+
+ // Registers the JNI calls.
+ static bool Register(JNIEnv* env);
+
+ // Overridden from WebContentsDelegate.
+ void AddNewContents(content::WebContents* source,
+ content::WebContents* new_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture,
+ bool* was_blocked) override;
+ void CloseContents(content::WebContents* source) override;
+ bool ShouldCreateWebContents(
+ content::WebContents* web_contents,
+ int route_id,
+ int main_frame_route_id,
+ WindowContainerType window_container_type,
+ const base::string16& frame_name,
+ const GURL& target_url,
+ const std::string& partition_id,
+ content::SessionStorageNamespace* session_storage_namespace) override;
+};
+
+#endif // CHROME_BROWSER_ANDROID_DOCUMENT_DOCUMENT_WEB_CONTENTS_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698