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

Side by Side Diff: chrome/browser/android/bottombar/contextualsearch/contextual_search_panel.h

Issue 1283223004: Contextual Search Panel should own ContentViewCore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Override wrappers instead of native Created 5 years, 3 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_BOTTOMBAR_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_PANE L_H_
6 #define CHROME_BROWSER_ANDROID_BOTTOMBAR_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_PANE L_H_
7
8 #include "base/android/jni_android.h"
9 #include "base/task/cancelable_task_tracker.h"
10 #include "chrome/browser/android/contextualsearch/contextual_search_context.h"
11
12 namespace content {
13 class WebContents;
14 } // namespace content
15
16 namespace web_contents_delegate_android {
17 class WebContentsDelegateAndroid;
18 } // namespace web_contents_delegate_android
19
20 // Manages the native extraction and request logic for Contextual Search,
21 // and interacts with the Java ContextualSearchPanel for UX.
22 // Most of the work is done by the associated ContextualSearchDelegate.
23 class ContextualSearchPanel {
24 public:
25 // Constructs a native manager associated with the Java manager.
26 ContextualSearchPanel(JNIEnv* env, jobject obj);
27 virtual ~ContextualSearchPanel();
28
29 // Called by the Java ContextualSearchPanel when it is being destroyed.
30 void Destroy(JNIEnv* env, jobject obj);
31
32 // Removes a search URL from history. |search_start_time_ms| represents the
33 // time at which |search_url| was committed.
34 void RemoveLastHistoryEntry(JNIEnv* env,
35 jobject obj,
36 jstring search_url,
37 jlong search_start_time_ms);
38
39 // Takes ownership of the WebContents associated with the given
40 // |ContentViewCore| which holds the Contextual Search Results.
41 void SetWebContents(JNIEnv* env, jobject obj, jobject jcontent_view_core,
42 jobject jweb_contents_delegate);
43
44 // Destroys the WebContents.
45 void DestroyWebContents(JNIEnv* env, jobject jobj);
46
47 // Release ownership of WebContents.
48 void ReleaseWebContents(JNIEnv* env, jobject jobj);
49
50 // Sets the delegate used to convert navigations to intents.
51 void SetInterceptNavigationDelegate(JNIEnv* env,
52 jobject obj,
53 jobject delegate,
54 jobject jweb_contents);
55
56 private:
57 // Our global reference to the Java ContextualSearchPanel.
58 base::android::ScopedJavaGlobalRef<jobject> java_manager_;
59
60 // Used if we need to clear history.
61 base::CancelableTaskTracker history_task_tracker_;
62
63 // The WebContents that holds the panel content.
64 scoped_ptr<content::WebContents> web_contents_;
65 scoped_ptr<web_contents_delegate_android::WebContentsDelegateAndroid>
66 web_contents_delegate_;
67
68 DISALLOW_COPY_AND_ASSIGN(ContextualSearchPanel);
69 };
70
71 bool RegisterContextualSearchPanel(JNIEnv* env);
72
73 #endif // CHROME_BROWSER_ANDROID_BOTTOMBAR_CONTEXTUALSEARCH_CONTEXTUAL_SEARCH_P ANEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698