summaryrefslogtreecommitdiffstats
path: root/components/web_contents_delegate_android
diff options
context:
space:
mode:
authorcramya@chromium.org <cramya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 00:23:40 +0000
committercramya@chromium.org <cramya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 00:23:40 +0000
commit91d953558729945bae978627ebc15350bae4f94c (patch)
tree4ae7d28c6670d99b682adaa0b28250e17d11b312 /components/web_contents_delegate_android
parentd7ea25f3a113400d52b297d432c6634c3ce16609 (diff)
downloadchromium_src-91d953558729945bae978627ebc15350bae4f94c.zip
chromium_src-91d953558729945bae978627ebc15350bae4f94c.tar.gz
chromium_src-91d953558729945bae978627ebc15350bae4f94c.tar.bz2
Move android specific WebRTC notification implementation out of status_tray_android.
In Android, for every WebRTC call, a new notification is created. Using web_contents onNavigationStateChanged() and destroyWebContents() we create and destroy the webRTC notifications appropriately. BUG=231804,245326 Review URL: https://chromiumcodereview.appspot.com/16154036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/web_contents_delegate_android')
-rw-r--r--components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java16
-rw-r--r--components/web_contents_delegate_android/web_contents_delegate_android.cc16
2 files changed, 23 insertions, 9 deletions
diff --git a/components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java b/components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java
index ee3c34e..feb1ea8 100644
--- a/components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java
+++ b/components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java
@@ -25,6 +25,20 @@ public class WebContentsDelegateAndroid {
public static final int LOG_LEVEL_WARNING = 2;
// Equivalent of WebCore::WebConsoleMessage::LevelError.
public static final int LOG_LEVEL_ERROR = 3;
+
+ // Flags passed to the WebContentsDelegate.navigationStateChanged to tell it
+ // what has changed. Should match the values in invalidate_type.h.
+ // Equivalent of InvalidateTypes::INVALIDATE_TYPE_URL.
+ public static final int INVALIDATE_TYPE_URL = 1 << 0;
+ // Equivalent of InvalidateTypes::INVALIDATE_TYPE_TAB.
+ public static final int INVALIDATE_TYPE_TAB = 1 << 1;
+ // Equivalent of InvalidateTypes::INVALIDATE_TYPE_LOAD.
+ public static final int INVALIDATE_TYPE_LOAD = 1 << 2;
+ // Equivalent of InvalidateTypes::INVALIDATE_TYPE_PAGE_ACTIONS.
+ public static final int INVALIDATE_TYPE_PAGE_ACTIONS = 1 << 3;
+ // Equivalent of InvalidateTypes::INVALIDATE_TYPE_TITLE.
+ public static final int INVALIDATE_TYPE_TITLE = 1 << 4;
+
// The most recent load progress callback received from WebContents, as a percentage.
// Initialize to 100 to indicate that we're not in a loading state.
private int mMostRecentProgress = 100;
@@ -56,7 +70,7 @@ public class WebContentsDelegateAndroid {
}
@CalledByNative
- public void onTitleUpdated() {
+ public void navigationStateChanged(int flags) {
}
@SuppressWarnings("unused")
diff --git a/components/web_contents_delegate_android/web_contents_delegate_android.cc b/components/web_contents_delegate_android/web_contents_delegate_android.cc
index f591de8..d8601eb 100644
--- a/components/web_contents_delegate_android/web_contents_delegate_android.cc
+++ b/components/web_contents_delegate_android/web_contents_delegate_android.cc
@@ -99,14 +99,14 @@ WebContents* WebContentsDelegateAndroid::OpenURLFromTab(
void WebContentsDelegateAndroid::NavigationStateChanged(
const WebContents* source, unsigned changed_flags) {
- if (changed_flags & content::INVALIDATE_TYPE_TITLE) {
- JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
- if (obj.is_null())
- return;
- Java_WebContentsDelegateAndroid_onTitleUpdated(
- env, obj.obj());
- }
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
+ if (obj.is_null())
+ return;
+ Java_WebContentsDelegateAndroid_navigationStateChanged(
+ env,
+ obj.obj(),
+ changed_flags);
}
void WebContentsDelegateAndroid::AddNewContents(