| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.bookmarks; | 5 package org.chromium.chrome.browser.bookmarks; |
| 6 | 6 |
| 7 import android.support.v4.widget.DrawerLayout; | |
| 8 | |
| 9 import org.chromium.chrome.browser.favicon.LargeIconBridge; | 7 import org.chromium.chrome.browser.favicon.LargeIconBridge; |
| 10 import org.chromium.chrome.browser.widget.selection.SelectionDelegate; | 8 import org.chromium.chrome.browser.widget.selection.SelectionDelegate; |
| 11 import org.chromium.components.bookmarks.BookmarkId; | 9 import org.chromium.components.bookmarks.BookmarkId; |
| 12 | 10 |
| 13 /** | 11 /** |
| 14 * Interface used by UI components in the main bookmarks UI to broadcast UI chan
ge notifications | 12 * Interface used by UI components in the main bookmarks UI to broadcast UI chan
ge notifications |
| 15 * and get bookmark data model. | 13 * and get bookmark data model. |
| 16 */ | 14 */ |
| 17 interface BookmarkDelegate { | 15 interface BookmarkDelegate { |
| 18 | 16 |
| 19 /** | 17 /** |
| 20 * Delegate used to open urls for main fragment on tablet. | 18 * Delegate used to open urls for main fragment on tablet. |
| 21 */ | 19 */ |
| 22 interface BookmarkStateChangeListener { | 20 interface BookmarkStateChangeListener { |
| 23 /** | 21 /** |
| 24 * Let the tab containing bookmark manager load the url and later handle
UI updates. | 22 * Let the tab containing bookmark manager load the url and later handle
UI updates. |
| 25 * @param url The url to open in tab. | 23 * @param url The url to open in tab. |
| 26 */ | 24 */ |
| 27 public void onBookmarkUIStateChange(String url); | 25 public void onBookmarkUIStateChange(String url); |
| 28 } | 26 } |
| 29 | 27 |
| 30 /** | 28 /** |
| 31 * Returns whether the bookmarks UI will be shown in a dialog, instead of a
NativePage. This is | 29 * Returns whether the bookmarks UI will be shown in a dialog, instead of a
NativePage. This is |
| 32 * typically true on phones and false on tablets, but not always, e.g. in mu
lti-window mode or | 30 * typically true on phones and false on tablets, but not always, e.g. in mu
lti-window mode or |
| 33 * after upgrading to the new bookmarks. | 31 * after upgrading to the new bookmarks. |
| 34 */ | 32 */ |
| 35 boolean isDialogUi(); | 33 boolean isDialogUi(); |
| 36 | 34 |
| 37 /** | 35 /** |
| 38 * Corresponds to any folder named list item in the side drawer. Shows bookm
arks under the | 36 * Shows bookmarks contained in the specified folder. |
| 39 * folder. | |
| 40 * @param folder Parent folder that contains bookmarks to show as its childr
en. | 37 * @param folder Parent folder that contains bookmarks to show as its childr
en. |
| 41 */ | 38 */ |
| 42 void openFolder(BookmarkId folder); | 39 void openFolder(BookmarkId folder); |
| 43 | 40 |
| 44 /** | 41 /** |
| 45 * @return The SelectionDelegate responsible for tracking selected bookmarks
. | 42 * @return The SelectionDelegate responsible for tracking selected bookmarks
. |
| 46 */ | 43 */ |
| 47 SelectionDelegate<BookmarkId> getSelectionDelegate(); | 44 SelectionDelegate<BookmarkId> getSelectionDelegate(); |
| 48 | 45 |
| 49 /** | 46 /** |
| 50 * Notifies the current mode set event to the given observer. For example, i
f the current mode | 47 * Notifies the current mode set event to the given observer. For example, i
f the current mode |
| 51 * is MODE_ALL_BOOKMARKS, it calls onAllBookmarksModeSet. | 48 * is MODE_ALL_BOOKMARKS, it calls onAllBookmarksModeSet. |
| 52 */ | 49 */ |
| 53 void notifyStateChange(BookmarkUIObserver observer); | 50 void notifyStateChange(BookmarkUIObserver observer); |
| 54 | 51 |
| 55 /** | 52 /** |
| 56 * @return Whether there is a drawer. | |
| 57 */ | |
| 58 boolean doesDrawerExist(); | |
| 59 | |
| 60 /** | |
| 61 * Close drawer if it's visible. | |
| 62 */ | |
| 63 void closeDrawer(); | |
| 64 | |
| 65 /** | |
| 66 * @return The current drawer layout instance, if it exists. | |
| 67 */ | |
| 68 DrawerLayout getDrawerLayout(); | |
| 69 | |
| 70 /** | |
| 71 * Closes the Bookmark UI (if on phone) and opens the given bookmark. | 53 * Closes the Bookmark UI (if on phone) and opens the given bookmark. |
| 72 * @param bookmark bookmark to open. | 54 * @param bookmark bookmark to open. |
| 73 * @param launchLocation The UI location where user tried to open bookmark.
It is one of | 55 * @param launchLocation The UI location where user tried to open bookmark.
It is one of |
| 74 * {@link BookmarkLaunchLocation} values | 56 * {@link BookmarkLaunchLocation} values |
| 75 */ | 57 */ |
| 76 void openBookmark(BookmarkId bookmark, int launchLocation); | 58 void openBookmark(BookmarkId bookmark, int launchLocation); |
| 77 | 59 |
| 78 /** | 60 /** |
| 79 * Shows the search UI. | 61 * Shows the search UI. |
| 80 */ | 62 */ |
| (...skipping 23 matching lines...) Expand all Loading... |
| 104 * @return Current UIState of bookmark main UI. If no mode is stored, | 86 * @return Current UIState of bookmark main UI. If no mode is stored, |
| 105 * {@link BookmarkUIState#STATE_LOADING} is returned. | 87 * {@link BookmarkUIState#STATE_LOADING} is returned. |
| 106 */ | 88 */ |
| 107 int getCurrentState(); | 89 int getCurrentState(); |
| 108 | 90 |
| 109 /** | 91 /** |
| 110 * @return LargeIconBridge instance. By sharing the instance, we can also sh
are the cache. | 92 * @return LargeIconBridge instance. By sharing the instance, we can also sh
are the cache. |
| 111 */ | 93 */ |
| 112 LargeIconBridge getLargeIconBridge(); | 94 LargeIconBridge getLargeIconBridge(); |
| 113 } | 95 } |
| OLD | NEW |