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

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

Issue 1982803002: Record UMA for snackbars shown for all purposes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 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.app.Activity; 7 import android.app.Activity;
8 import android.content.ComponentName; 8 import android.content.ComponentName;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 bookmarkModel.getBookmarkById(bookmarkId).getParentId()); 90 bookmarkModel.getBookmarkById(bookmarkId).getParentId());
91 SnackbarController snackbarController = 91 SnackbarController snackbarController =
92 createSnackbarControllerForEditButton(activity, bookmarkId); 92 createSnackbarControllerForEditButton(activity, bookmarkId);
93 if (getLastUsedParent(activity) == null) { 93 if (getLastUsedParent(activity) == null) {
94 snackbar = Snackbar.make(activity.getString(R.string.bookmark_pa ge_saved), 94 snackbar = Snackbar.make(activity.getString(R.string.bookmark_pa ge_saved),
95 snackbarController, Snackbar.TYPE_ACTION); 95 snackbarController, Snackbar.TYPE_ACTION);
96 } else { 96 } else {
97 snackbar = Snackbar.make(folderName, snackbarController, Snackba r.TYPE_ACTION) 97 snackbar = Snackbar.make(folderName, snackbarController, Snackba r.TYPE_ACTION)
98 .setTemplateText(activity.getString(R.string.bookmark_pa ge_saved_folder)); 98 .setTemplateText(activity.getString(R.string.bookmark_pa ge_saved_folder));
99 } 99 }
100 snackbar.setSingleLine(false).setAction( 100 snackbar.setSingleLine(false).setAction(activity.getString(R.string. bookmark_item_edit),
101 activity.getString(R.string.bookmark_item_edit), null); 101 null).setPurpose(Snackbar.UMA_BOOKMARK_ADDED);
102 } 102 }
103 snackbarManager.showSnackbar(snackbar); 103 snackbarManager.showSnackbar(snackbar);
104 104
105 bookmarkModel.destroy(); 105 bookmarkModel.destroy();
106 return bookmarkId; 106 return bookmarkId;
107 } 107 }
108 108
109 /** 109 /**
110 * Adds a bookmark with the given title and url to the last used parent fold er. Provides 110 * Adds a bookmark with the given title and url to the last used parent fold er. Provides
111 * no visual feedback that a bookmark has been added. 111 * no visual feedback that a bookmark has been added.
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 /** 282 /**
283 * @return Whether "all bookmarks" section is enabled. 283 * @return Whether "all bookmarks" section is enabled.
284 */ 284 */
285 static boolean isAllBookmarksViewEnabled() { 285 static boolean isAllBookmarksViewEnabled() {
286 String flag = CommandLine.getInstance() 286 String flag = CommandLine.getInstance()
287 .getSwitchValue(ChromeSwitches.ENABLE_ALL_BOOKMARKS_VIEW, "false "); 287 .getSwitchValue(ChromeSwitches.ENABLE_ALL_BOOKMARKS_VIEW, "false ");
288 return flag.equals("true"); 288 return flag.equals("true");
289 } 289 }
290 } 290 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698