Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/BookmarksBridge.java

Issue 1285313003: [Offline pages] Wiring saving and opening offline page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address more feedback Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 package org.chromium.chrome.browser; 5 package org.chromium.chrome.browser;
6 6
7 import android.util.Pair; 7 import android.util.Pair;
8 8
9 import org.chromium.base.ObserverList; 9 import org.chromium.base.ObserverList;
10 import org.chromium.base.VisibleForTesting; 10 import org.chromium.base.VisibleForTesting;
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 } 558 }
559 559
560 public boolean isEditBookmarksEnabled() { 560 public boolean isEditBookmarksEnabled() {
561 return nativeIsEditBookmarksEnabled(mNativeBookmarksBridge); 561 return nativeIsEditBookmarksEnabled(mNativeBookmarksBridge);
562 } 562 }
563 563
564 public static boolean isEnhancedBookmarksEnabled(Profile profile) { 564 public static boolean isEnhancedBookmarksEnabled(Profile profile) {
565 return nativeIsEnhancedBookmarksFeatureEnabled(profile); 565 return nativeIsEnhancedBookmarksFeatureEnabled(profile);
566 } 566 }
567 567
568 /**
569 * Notifies the observer that bookmark model has been loaded.
570 */
571 protected void notifyBookmarkModelLoaded() {
572 // Call isBookmarkModelLoaded() to do the check since it could be overri dden by the child
573 // class to add the addition logic.
574 if (isBookmarkModelLoaded()) {
575 for (BookmarkModelObserver observer : mObservers) {
576 observer.bookmarkModelLoaded();
577 }
578 }
579 }
580
568 @CalledByNative 581 @CalledByNative
569 private void bookmarkModelLoaded() { 582 private void bookmarkModelLoaded() {
570 mIsNativeBookmarkModelLoaded = true; 583 mIsNativeBookmarkModelLoaded = true;
571 584
572 for (BookmarkModelObserver observer : mObservers) { 585 notifyBookmarkModelLoaded();
573 observer.bookmarkModelLoaded();
574 }
575 586
576 if (!mDelayedBookmarkCallbacks.isEmpty()) { 587 if (!mDelayedBookmarkCallbacks.isEmpty()) {
577 for (int i = 0; i < mDelayedBookmarkCallbacks.size(); i++) { 588 for (int i = 0; i < mDelayedBookmarkCallbacks.size(); i++) {
578 mDelayedBookmarkCallbacks.get(i).callCallbackMethod(); 589 mDelayedBookmarkCallbacks.get(i).callCallbackMethod();
579 } 590 }
580 mDelayedBookmarkCallbacks.clear(); 591 mDelayedBookmarkCallbacks.clear();
581 } 592 }
582 } 593 }
583 594
584 @CalledByNative 595 @CalledByNative
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 case GET_CURRENT_FOLDER_HIERARCHY: 856 case GET_CURRENT_FOLDER_HIERARCHY:
846 mHandler.getCurrentFolderHierarchy(mFolderId, mCallback); 857 mHandler.getCurrentFolderHierarchy(mFolderId, mCallback);
847 break; 858 break;
848 default: 859 default:
849 assert false; 860 assert false;
850 break; 861 break;
851 } 862 }
852 } 863 }
853 } 864 }
854 } 865 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698