| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bookmarks/bookmarks_bridge.h" | 5 #include "chrome/browser/android/bookmarks/bookmarks_bridge.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "base/containers/stack_container.h" | 8 #include "base/containers/stack_container.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 using content::BrowserThread; | 29 using content::BrowserThread; |
| 30 | 30 |
| 31 // Should mirror constants in BookmarksBridge.java | 31 // Should mirror constants in BookmarksBridge.java |
| 32 static const int kBookmarkTypeNormal = 0; | 32 static const int kBookmarkTypeNormal = 0; |
| 33 static const int kBookmarkTypePartner = 1; | 33 static const int kBookmarkTypePartner = 1; |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 class BookmarkNodeCreationTimeCompareFunctor { | 36 class BookmarkNodeCreationTimeCompareFunctor { |
| 37 public: | 37 public: |
| 38 bool operator()(const BookmarkNode* lhs, const BookmarkNode* rhs) { | 38 bool operator()(const BookmarkNode* lhs, const BookmarkNode* rhs) { |
| 39 return lhs->date_added().ToJavaTime() < rhs->date_added().ToJavaTime(); | 39 return lhs->date_added().ToJavaTime() > rhs->date_added().ToJavaTime(); |
| 40 } | 40 } |
| 41 }; | 41 }; |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 BookmarksBridge::BookmarksBridge(JNIEnv* env, | 44 BookmarksBridge::BookmarksBridge(JNIEnv* env, |
| 45 jobject obj, | 45 jobject obj, |
| 46 jobject j_profile) | 46 jobject j_profile) |
| 47 : weak_java_ref_(env, obj), | 47 : weak_java_ref_(env, obj), |
| 48 bookmark_model_(NULL), | 48 bookmark_model_(NULL), |
| 49 client_(NULL), | 49 client_(NULL), |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 BookmarkModelChanged(); | 643 BookmarkModelChanged(); |
| 644 } | 644 } |
| 645 | 645 |
| 646 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { | 646 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { |
| 647 NotifyIfDoneLoading(); | 647 NotifyIfDoneLoading(); |
| 648 } | 648 } |
| 649 | 649 |
| 650 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { | 650 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { |
| 651 partner_bookmarks_shim_ = NULL; | 651 partner_bookmarks_shim_ = NULL; |
| 652 } | 652 } |
| OLD | NEW |