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 <list> | 7 #include <list> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 const base::string16& title, | 210 const base::string16& title, |
211 const base::string16& url, | 211 const base::string16& url, |
212 const bool is_folder, | 212 const bool is_folder, |
213 const int64 parent_id, | 213 const int64 parent_id, |
214 int64* result) { | 214 int64* result) { |
215 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 215 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
216 DCHECK(result); | 216 DCHECK(result); |
217 GURL gurl = ParseAndMaybeAppendScheme(url, kDefaultUrlScheme); | 217 GURL gurl = ParseAndMaybeAppendScheme(url, kDefaultUrlScheme); |
218 | 218 |
219 // Check if the bookmark already exists. | 219 // Check if the bookmark already exists. |
220 const BookmarkNode* node = model->GetMostRecentlyAddedUserNodeForURL(gurl); | 220 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(gurl); |
221 if (!node) { | 221 if (!node) { |
222 const BookmarkNode* parent_node = NULL; | 222 const BookmarkNode* parent_node = NULL; |
223 if (parent_id >= 0) | 223 if (parent_id >= 0) |
224 parent_node = GetBookmarkNodeByID(model, parent_id); | 224 parent_node = GetBookmarkNodeByID(model, parent_id); |
225 if (!parent_node) | 225 if (!parent_node) |
226 parent_node = model->bookmark_bar_node(); | 226 parent_node = model->bookmark_bar_node(); |
227 | 227 |
228 if (is_folder) | 228 if (is_folder) |
229 node = model->AddFolder(parent_node, parent_node->child_count(), title); | 229 node = model->AddFolder(parent_node, parent_node->child_count(), title); |
230 else | 230 else |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 Java_ChromeBrowserProvider_onBookmarkChanged(env, obj.obj()); | 1617 Java_ChromeBrowserProvider_onBookmarkChanged(env, obj.obj()); |
1618 } else if (type == | 1618 } else if (type == |
1619 chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED) { | 1619 chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED) { |
1620 JNIEnv* env = AttachCurrentThread(); | 1620 JNIEnv* env = AttachCurrentThread(); |
1621 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); | 1621 ScopedJavaLocalRef<jobject> obj = weak_java_provider_.get(env); |
1622 if (obj.is_null()) | 1622 if (obj.is_null()) |
1623 return; | 1623 return; |
1624 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj()); | 1624 Java_ChromeBrowserProvider_onSearchTermChanged(env, obj.obj()); |
1625 } | 1625 } |
1626 } | 1626 } |
OLD | NEW |