| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 model->Remove(parent_node, parent_node->GetIndexOf(node)); | 263 model->Remove(parent_node, parent_node->GetIndexOf(node)); |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 | 266 |
| 267 // Verify that the bookmark was actually removed. Called synchronously. | 267 // Verify that the bookmark was actually removed. Called synchronously. |
| 268 virtual void BookmarkNodeRemoved( | 268 virtual void BookmarkNodeRemoved( |
| 269 BookmarkModel* bookmark_model, | 269 BookmarkModel* bookmark_model, |
| 270 const BookmarkNode* parent, | 270 const BookmarkNode* parent, |
| 271 int old_index, | 271 int old_index, |
| 272 const BookmarkNode* node, | 272 const BookmarkNode* node, |
| 273 const std::set<GURL>& removed_urls) OVERRIDE { | 273 const std::set<GURL>& removed_urls) override { |
| 274 if (bookmark_model == model() && node->id() == id_to_delete_) | 274 if (bookmark_model == model() && node->id() == id_to_delete_) |
| 275 ++deleted_; | 275 ++deleted_; |
| 276 } | 276 } |
| 277 | 277 |
| 278 private: | 278 private: |
| 279 int deleted_; | 279 int deleted_; |
| 280 int64 id_to_delete_; | 280 int64 id_to_delete_; |
| 281 | 281 |
| 282 DISALLOW_COPY_AND_ASSIGN(RemoveBookmarkTask); | 282 DISALLOW_COPY_AND_ASSIGN(RemoveBookmarkTask); |
| 283 }; | 283 }; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 bookmarks::GetBookmarkNodeByID(model, parent_id); | 347 bookmarks::GetBookmarkNodeByID(model, parent_id); |
| 348 | 348 |
| 349 if (new_parent) | 349 if (new_parent) |
| 350 model->Move(node, new_parent, 0); | 350 model->Move(node, new_parent, 0); |
| 351 } | 351 } |
| 352 } | 352 } |
| 353 } | 353 } |
| 354 | 354 |
| 355 // Verify that the bookmark was actually updated. Called synchronously. | 355 // Verify that the bookmark was actually updated. Called synchronously. |
| 356 virtual void BookmarkNodeChanged(BookmarkModel* bookmark_model, | 356 virtual void BookmarkNodeChanged(BookmarkModel* bookmark_model, |
| 357 const BookmarkNode* node) OVERRIDE { | 357 const BookmarkNode* node) override { |
| 358 if (bookmark_model == model() && node->id() == id_to_update_) | 358 if (bookmark_model == model() && node->id() == id_to_update_) |
| 359 ++updated_; | 359 ++updated_; |
| 360 } | 360 } |
| 361 | 361 |
| 362 private: | 362 private: |
| 363 int updated_; | 363 int updated_; |
| 364 int64 id_to_update_; | 364 int64 id_to_update_; |
| 365 | 365 |
| 366 DISALLOW_COPY_AND_ASSIGN(UpdateBookmarkTask); | 366 DISALLOW_COPY_AND_ASSIGN(UpdateBookmarkTask); |
| 367 }; | 367 }; |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 Java_ChromeBrowserProvider_onHistoryChanged(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 |