Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Show folder when an offline page is saved
Browse files Browse the repository at this point in the history
Snackbar string is updated in this CL to show the folder destination of
the newly added offline page.

BUG=579220

Review URL: https://codereview.chromium.org/1603183002

Cr-Commit-Position: refs/heads/master@{#370233}
[email protected]

Review URL: https://codereview.chromium.org/1617943002 .

Cr-Commit-Position: refs/branch-heads/2623@{#48}
Cr-Branched-From: 92d7753-refs/heads/master@{#369907}
  • Loading branch information
Ian Wen committed Jan 21, 2016
1 parent b716f4a commit 44b8874
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ private static void showSnackbarForAddingBookmark(final EnhancedBookmarksModel b
} else {
SnackbarController snackbarController = null;
int messageId;
String suffix = null;
int buttonId = R.string.enhanced_bookmark_item_edit;

if (saveResult == AddBookmarkCallback.SKIPPED) {
Expand All @@ -139,15 +140,23 @@ private static void showSnackbarForAddingBookmark(final EnhancedBookmarksModel b
snackbarController = createSnackbarControllerForFreeUpSpaceButton(
bookmarkModel, snackbarManager, activity);
} else {
messageId = saveResult == AddBookmarkCallback.SAVED
? R.string.offline_pages_page_saved
: R.string.offline_pages_page_failed_to_save;
if (saveResult == AddBookmarkCallback.SAVED) {
if (getLastUsedParent(activity) == null) {
messageId = R.string.offline_pages_page_saved;
} else {
messageId = R.string.offline_pages_page_saved_folder;
suffix = bookmarkModel.getBookmarkTitle(
bookmarkModel.getBookmarkById(bookmarkId).getParentId());
}
} else {
messageId = R.string.offline_pages_page_failed_to_save;
}
}
if (snackbarController == null) {
snackbarController = createSnackbarControllerForEditButton(
bookmarkModel, activity, bookmarkId);
}
snackbar = Snackbar.make(activity.getString(messageId), snackbarController)
snackbar = Snackbar.make(activity.getString(messageId, suffix), snackbarController)
.setAction(activity.getString(buttonId), null).setSingleLine(false);
}

Expand Down
3 changes: 3 additions & 0 deletions chrome/android/java/strings/android_chrome_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -1963,6 +1963,9 @@ Just open Chrome on your computer, go to the menu, and select “Sign in to Chro
<message name="IDS_OFFLINE_PAGES_PAGE_SAVED" desc="Message shown after user adds a new offline page.">
Page saved offline
</message>
<message name="IDS_OFFLINE_PAGES_PAGE_SAVED_FOLDER" desc="Message shown after user saves a new offline page. Also specifies in which folder the bookmark was added. [CHAR-LIMIT=32]">
Page saved offline to <ph name="FOLDER_NAME">%1$s<ex>Mobile bookmarks</ex></ph>
</message>
<message name="IDS_OFFLINE_PAGES_PAGE_SKIPPED" desc="Message shown after a page was saved as a bookmark, but an offline copy was not created due to that the page is not HTTP or HTTPS page.">
Page saved
</message>
Expand Down

0 comments on commit 44b8874

Please sign in to comment.