summaryrefslogtreecommitdiffstats
path: root/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove legacy StartsWithASCII function.brettw2015-07-161-1/+2
| | | | | | | | | | | This replaces it with base::StartsWith and the appropriate case flag. Since the existing version only ever did case-insensitive tests in ASCII, there should be no behavior change. BUG=506255 TBR=jam Review URL: https://codereview.chromium.org/1242023005 Cr-Commit-Position: refs/heads/master@{#339175}
* Move StartsWith[ASCII] to base namespace.brettw2015-06-121-1/+1
| | | | | | | | | NOPRESUBMIT=true (no presubmit due to removing base:: from a ScopedAllowIO) Review URL: https://codereview.chromium.org/1172183002 Cr-Commit-Position: refs/heads/master@{#334108}
* Avoid unnacessarily conversion from index to BookmarkNode pointer.deepak.m12015-05-041-6/+4
| | | | | | | | | | | | | | BookmarkModel::Remove() should take BookmarkNode pointer. This will few save conversion from BookmarkNode pointer to index for calling Remove and converting index to BookmarkNode pointer to call RemoveAndDeleteNode(). This way we will able to save call's like parent->GetIndexOf(node),and again conversion to Bookmark Pointer. BUG=330842 Review URL: https://codereview.chromium.org/1105413002 Cr-Commit-Position: refs/heads/master@{#328135}
* Dont set NEEDS_OFFLINE_PROCESSING flag.rfevang2015-02-051-79/+0
| | | | | | | | | | | The server will now always do processing for nodes that don't have stars.id set, so no need to flip this flag any more. BUG= Review URL: https://codereview.chromium.org/888983002 Cr-Commit-Position: refs/heads/master@{#314900}
* bookmarks: Move BookmarkNode into 'bookmarks' namespace.tfarina2015-02-041-0/+1
| | | | | | | | | | | BUG=370433 TEST=unit_tests, components_unittests R=sky@chromium.org TBR=joaodasilva@chromium.org (for policy) Review URL: https://codereview.chromium.org/865163003 Cr-Commit-Position: refs/heads/master@{#314653}
* Add method for removing bookmark image data.rfevang2015-02-041-0/+22
| | | | | | | | | | | | Removes all image data associated with the bookmark, and sets the user_removed_image flag so the server won't attempt to set a new image for the bookmark. BUG=434436 Review URL: https://codereview.chromium.org/891873002 Cr-Commit-Position: refs/heads/master@{#314613}
* bookmarks: Move BookmarkModel into 'bookmarks' namespace.tfarina2015-01-121-0/+1
| | | | | | | | | | | BUG=370433 TEST=unit_tests, components_unittests R=sky@chromium.org TBR=joaodasilva@chromium.org (for components/policy) Review URL: https://codereview.chromium.org/820603005 Cr-Commit-Position: refs/heads/master@{#311074}
* Set the version string nodes created in the enhanced bookmark model.rfevang2014-12-081-1/+3
| | | | | | | | | | | The version field is now set when the enhanced bookmark model creates nodes, not just when it edits the meta info fields of existing nodes. BUG=411412 Review URL: https://codereview.chromium.org/748783004 Cr-Commit-Position: refs/heads/master@{#307310}
* Reset remote ids of bookmark nodes when creating a clone.rfevang2014-12-061-0/+6
| | | | | | | | BUG=419528 Review URL: https://codereview.chromium.org/620453004 Cr-Commit-Position: refs/heads/master@{#307136}
* Remove children of removed nodes from maps.rfevang2014-11-191-0/+12
| | | | | | | | | | | | | When a folder containing children is removed, only the folder node gets a BookmarkNodeRemoved event, while all its children are also deleted. This CL makes sure to also remove the child nodes from the various maps so we won't later crash trying to dereference the now deleted nodes. BUG=422959 Review URL: https://codereview.chromium.org/734983005 Cr-Commit-Position: refs/heads/master@{#304844}
* Revert "Revert of Reduce frequency of requesting bookmark clusters. ↵danduong2014-10-301-0/+17
| | | | | | | | | | | | (patchset #8 id:140001 of https://codereview.chromium.org/682933002/)" This reverts commit 8077169fda2b11a06ec08983c98d1e133d6c9c79. BUG=424254 Review URL: https://codereview.chromium.org/695493004 Cr-Commit-Position: refs/heads/master@{#302187}
* Revert of Reduce frequency of requesting bookmark clusters. (patchset #8 ↵csharp2014-10-301-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:140001 of https://codereview.chromium.org/682933002/) Reason for revert: This appears to have broken Chromium Linux on Android Arm64 Builder (dbg). FAILED: /mnt/data/b/build/goma/gomacc /mnt/data/b/build/slave/Android_Arm64_Builder__dbg_/build/src/third_party/android_tools/ndk//toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++ -MMD -MF obj/chrome/browser/android/enhanced_bookmarks/browser.enhanced_bookmarks_bridge.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DNO_TCMALLOC -DDISABLE_NACL -DCHROMIUM_BUILD -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_BROWSER_CDMS -DENABLE_CONFIGURATION_POLICY -DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DENABLE_AUTOFILL_DIALOG=1 -DCLD_VERSION=1 -DENABLE_PRINTING=1 -DENABLE_MANAGED_USERS=1 -DVIDEO_HOLE=1 -DENABLE_LOAD_COMPLETION_HACKS=1 -DNACL_WINDOWS=0 -DNACL_LINUX=1 -DNACL_OSX=0 -DNACL_ANDROID=1 -DFULL_SAFE_BROWSING -DMOJO_USE_SYSTEM_IMPL -DPROTOBUF_USE_DLLS -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DAUTOFILL_ENABLE_SYNC -DPASSWORD_MANAGER_ENABLE_SYNC '-DPRECACHE_CONFIG_SETTINGS_URL="https://www.gstatic.com/chrome/wifiprefetch/precache_config"' '-DPRECACHE_MANIFEST_URL_PREFIX="https://www.gstatic.com/chrome/wifiprefetch/precache_manifest_"' -DAPPCACHE_USE_SIMPLE_CACHE -DSK_ENABLE_INST_COUNT=0 -DSK_SUPPORT_GPU=1 '-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' -DSK_ENABLE_LEGACY_API_ALIASING=1 -DSK_ATTR_DEPRECATED=SK_NOTHING_ARG1 -DGR_GL_IGNORE_ES3_MSAA=0 -DSK_WILL_NEVER_DRAW_PERSPECTIVE_TEXT -DSK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER=1 -DSK_SUPPORT_LEGACY_TEXTRENDERMODE -DSK_LEGACY_NO_DISTANCE_FIELD_PATHS -DSK_BUILD_FOR_ANDROID -DSK_USE_POSIX_THREADS -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DFEATURE_ENABLE_SSL -DFEATURE_ENABLE_VOICEMAIL -DEXPAT_RELATIVE_PATH -DGTEST_RELATIVE_PATH -DNO_MAIN_THREAD_WRAPPING -DNO_SOUND_SYSTEM -DANDROID -DPOSIX -DWEBRTC_POSIX -DLIBXML_STATIC -DPOSIX_AVOID_MMAP -DMEDIA_DISABLE_LIBVPX -DXML_STATIC -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_LINUX -DWEBRTC_ANDROID -DWEBRTC_ANDROID_OPENSLES -DMESA_EGL_NO_X11_HEADERS -DUSE_OPENSSL=1 -DUSE_OPENSSL_CERTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__GNU_SOURCE=1 -DUSE_STLPORT=1 -D_STLP_USE_PTR_SPECIALIZATIONS=1 '-DCHROME_BUILD_ID=""' -DHAVE_SYS_UIO_H -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -Igen -I../.. -Iobj/chrome/browser.gen -I../../third_party/khronos -I../../gpu -I../../skia/config -I../../third_party/WebKit/Source -Igen/angle -Igen/protoc_out -I../../third_party/protobuf -I../../third_party/protobuf/src -I../../third_party/dom_distiller_js/package/proto_gen -Igen/chrome -Igen/components/strings -I../../third_party/WebKit -I../../third_party/skia/src/core -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/pdf -I../../third_party/skia/include/gpu -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../skia/ext -I../../third_party/cacheinvalidation/overrides -I../../third_party/cacheinvalidation/src -I../../third_party/cacheinvalidation/google/cacheinvalidation -I../../third_party/icu/source/i18n -I../../third_party/icu/source/common -I../../third_party/webrtc/overrides -I../../third_party/libjingle/overrides -I../../third_party/libjingle/source -I../../testing/gtest/include -I../../third_party -I../../third_party/libxml/linux/include -I../../third_party/libxml/src/include -I../../third_party/zlib -Igen/ui/resources -I../../third_party/re2 -Igen/content/app/resources/ -I../../third_party/expat/files/lib -I../../third_party/leveldatabase/src/include -I../../third_party/leveldatabase/src -I../../third_party/leveldatabase -I../../third_party/libyuv/include -I../../third_party/libyuv -I../../third_party/npapi -I../../third_party/npapi/bindings -Igen/ui/gl -I../../third_party/mesa/src/include -I../../v8/include -Igen/policy --param=ssp-buffer-size=4 -Werror -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -ffunction-sections -funwind-tables -g -fno-short-enums -finline-limit=64 -Wa,--noexecstack --sysroot=/mnt/data/b/build/slave/Android_Arm64_Builder__dbg_/build/src/third_party/android_tools/ndk//platforms/android-21/arch-arm64 -isystem/mnt/data/b/build/slave/Android_Arm64_Builder__dbg_/build/src/third_party/android_tools/ndk//sources/cxx-stl/stlport/stlport -Os -g -gdwarf-4 -fdata-sections -ffunction-sections -funwind-tables -g1 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -std=gnu++11 -Wno-narrowing -Wno-literal-suffix -c ../../chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.cc -o obj/chrome/browser/android/enhanced_bookmarks/browser.enhanced_bookmarks_bridge.o ../../chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.cc: In constructor 'enhanced_bookmarks::android::EnhancedBookmarksBridge::EnhancedBookmarksBridge(JNIEnv*, jobject, Profile*)': ../../chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.cc:52:67:error: invalid new-expression of abstract class type 'enhanced_bookmarks::BookmarkServerSearchService' EnhancedBookmarkModelFactory::GetForBrowserContext(profile_))); ^ In file included from ../../chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.h:12:0, from ../../chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.cc:5: ../../components/enhanced_bookmarks/bookmark_server_search_service.h:21:7: note: because the following virtual functions are pure within 'enhanced_bookmarks::BookmarkServerSearchService': class BookmarkServerSearchService : public BookmarkServerService { ^ In file included from ../../components/enhanced_bookmarks/bookmark_server_service.h:11:0, from ../../components/enhanced_bookmarks/bookmark_server_search_service.h:12, from ../../chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.h:12, from ../../chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.cc:5: ../../components/enhanced_bookmarks/enhanced_bookmark_model_observer.h:29:16: note: virtual void enhanced_bookmarks::EnhancedBookmarkModelObserver::EnhancedBookmarkNodeChanged(const BookmarkNode*) virtual void EnhancedBookmarkNodeChanged(const BookmarkNode* node) = 0; ^ In file included from ../../storage/browser/fileapi/plugin_private_file_system_backend.h:13:0, from ../../storage/browser/fileapi/file_system_context.h:20, from ../../content/public/browser/content_browser_client.h:30, from ../../chrome/browser/profiles/profile.h:17, from ../../chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.h:10, from ../../chrome/browser/android/enhanced_bookmarks/enhanced_bookmarks_bridge.cc:5: ../../storage/browser/fileapi/file_system_backend.h: At global scope: ../../storage/browser/fileapi/file_system_backend.h:43:13:error: 'storage::kMaximumLength' defined but not used [-Werror=unused-variable] const int64 kMaximumLength = std::numeric_limits<int64>::max(); Original issue's description: > Reduce frequency of requesting bookmark clusters. > > Currently, we fetch for bookmarks on SyncCycleCompleted. We > actually just want to trigger a request for clusters when > bookmarks change due to a SyncCycle. By watching for > ExtensiveChanges from the BookmarksModel and saving some > state, we can more accurately determine this. > > BUG=424254 > > Committed: https://crrev.com/2d0c8cfc2d67eea473132d8582430c21529ce897 > Cr-Commit-Position: refs/heads/master@{#302111} TBR=yfriedman@chromium.org,kkimlabs@chromium.org,noyau@chromium.org,mcolbert@chromium.org,danduong@chromium.org NOTREECHECKS=true NOTRY=true BUG=424254 Review URL: https://codereview.chromium.org/693513003 Cr-Commit-Position: refs/heads/master@{#302118}
* Reduce frequency of requesting bookmark clusters.danduong2014-10-301-0/+17
| | | | | | | | | | | | | | Currently, we fetch for bookmarks on SyncCycleCompleted. We actually just want to trigger a request for clusters when bookmarks change due to a SyncCycle. By watching for ExtensiveChanges from the BookmarksModel and saving some state, we can more accurately determine this. BUG=424254 Review URL: https://codereview.chromium.org/682933002 Cr-Commit-Position: refs/heads/master@{#302111}
* Standardize usage of virtual/override/final specifiers.dcheng2014-10-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Google C++ style guide states: Explicitly annotate overrides of virtual functions or virtual destructors with an override or (less frequently) final specifier. Older (pre-C++11) code will use the virtual keyword as an inferior alternative annotation. For clarity, use exactly one of override, final, or virtual when declaring an override. To better conform to these guidelines, the following constructs have been rewritten: - if a base class has a virtual destructor, then: virtual ~Foo(); -> ~Foo() override; - virtual void Foo() override; -> void Foo() override; - virtual void Foo() override final; -> void Foo() final; This patch was automatically generated. The clang plugin can generate fixit hints, which are suggested edits when it is 100% sure it knows how to fix a problem. The hints from the clang plugin were applied to the source tree using the tool in https://codereview.chromium.org/598073004. BUG=417463 R=caitkp@chromium.org Review URL: https://codereview.chromium.org/684513002 Cr-Commit-Position: refs/heads/master@{#301931}
* Standardize usage of virtual/override/final in components/dcheng2014-10-211-11/+8
| | | | | | | | | BUG=417463 TBR=blundell@chromium.org Review URL: https://codereview.chromium.org/666133002 Cr-Commit-Position: refs/heads/master@{#300456}
* Set offline processing flag for new bookmarksrfevang2014-10-091-0/+89
| | | | | | | | | | Sets the NEEDS_OFFLINE_PROCESSING flag for nodes that are created by non-enhanced bookmark aware code. Also fixes a potential issue if a bookmark node was removed while there was a pending operation on it. BUG=411412 Review URL: https://codereview.chromium.org/626213002 Cr-Commit-Position: refs/heads/master@{#298935}
* replace OVERRIDE and FINAL with override and final in components/mostynb2014-10-061-8/+8
| | | | | | | | BUG=417463 Review URL: https://codereview.chromium.org/623133002 Cr-Commit-Position: refs/heads/master@{#298237}
* Fix lifetime of EnhancedBookmarkModel & BookmarkImageServicesdefresne2014-09-221-4/+4
| | | | | | | | | | | | | | | Unregister BookmarkImageService observer from BookmarkModel in the Shutdown method instead of the destructor to follow the two step shutdown of the profile. Fix a typo in the EnhancedBookmarkModel override of KeyedService Shutdown method (could have been caught by using the OVERRIDE keyword). BUG=None Review URL: https://codereview.chromium.org/588233002 Cr-Commit-Position: refs/heads/master@{#296009}
* Only set remote id during url node creation.rfevang2014-09-191-45/+316
| | | | | | | | | | | | Folders should only have their id set by the server, and the clients should only set the remote id on clips they created themselves. Additionally, EnhancedBookmarkModel now monitors the remote id field for bookmarks, and initiates a de-duping protocol whenever two (or more) nodes with the same id are detected. BUG=413876 Review URL: https://codereview.chromium.org/563363002 Cr-Commit-Position: refs/heads/master@{#295790}
* Move TestBookmarkClient into bookmarks namespace.tfarina2014-09-111-1/+1
| | | | | | | | | | | BUG=370433 TEST=None R=sky@chromium.org TBR=joaodasilva@chromium.org Review URL: https://codereview.chromium.org/562693002 Cr-Commit-Position: refs/heads/master@{#294329}
* Set version field when changes are made to enhanced bookmarks.rfevang2014-09-091-0/+380
Moves meta info helper functions into a new class EnhancedBookmarkModel, that writes the version field whenever other fields are modified. BUG=404227 Review URL: https://codereview.chromium.org/476573004 Cr-Commit-Position: refs/heads/master@{#294028}