OLD | NEW |
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 "chrome/browser/android/provider/chrome_browser_provider.h" | 5 #include "chrome/browser/android/provider/chrome_browser_provider.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <list> | 8 #include <list> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 void ChromeBrowserProvider::Observe( | 1606 void ChromeBrowserProvider::Observe( |
1607 int type, | 1607 int type, |
1608 const content::NotificationSource& source, | 1608 const content::NotificationSource& source, |
1609 const content::NotificationDetails& details) { | 1609 const content::NotificationDetails& details) { |
1610 if (type == chrome::NOTIFICATION_HISTORY_URL_VISITED || | 1610 if (type == chrome::NOTIFICATION_HISTORY_URL_VISITED || |
1611 type == chrome::NOTIFICATION_HISTORY_URLS_DELETED) { | 1611 type == chrome::NOTIFICATION_HISTORY_URLS_DELETED) { |
1612 JNIEnv* env = AttachCurrentThread(); | 1612 JNIEnv* env = AttachCurrentThread(); |
1613 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); | 1613 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); |
1614 if (obj.is_null()) | 1614 if (obj.is_null()) |
1615 return; | 1615 return; |
1616 Java_ChromeBrowserProvider_onBookmarkChanged(env, obj.obj()); | 1616 Java_ChromeBrowserProvider_onHistoryChanged(env, obj.obj()); |
1617 } else if (type == | 1617 } else if (type == |
1618 chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED) { | 1618 chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED) { |
1619 JNIEnv* env = AttachCurrentThread(); | 1619 JNIEnv* env = AttachCurrentThread(); |
1620 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); | 1620 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); |
1621 if (obj.is_null()) | 1621 if (obj.is_null()) |
1622 return; | 1622 return; |
1623 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj()); | 1623 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj()); |
1624 } | 1624 } |
1625 } | 1625 } |
OLD | NEW |