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

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

Issue 2772073002: Make Clipboard.java a singleton pattern. (Closed)
Patch Set: Fix shame Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.history; 5 package org.chromium.chrome.browser.history;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.ActivityManager; 8 import android.app.ActivityManager;
9 import android.content.ComponentName; 9 import android.content.ComponentName;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 if (item.getItemId() == R.id.close_menu_id && isDisplayedInSeparateActiv ity()) { 176 if (item.getItemId() == R.id.close_menu_id && isDisplayedInSeparateActiv ity()) {
177 mActivity.finish(); 177 mActivity.finish();
178 return true; 178 return true;
179 } else if (item.getItemId() == R.id.selection_mode_open_in_new_tab) { 179 } else if (item.getItemId() == R.id.selection_mode_open_in_new_tab) {
180 openItemsInNewTabs(mSelectionDelegate.getSelectedItems(), false); 180 openItemsInNewTabs(mSelectionDelegate.getSelectedItems(), false);
181 mSelectionDelegate.clearSelection(); 181 mSelectionDelegate.clearSelection();
182 return true; 182 return true;
183 } else if (item.getItemId() == R.id.selection_mode_copy_link) { 183 } else if (item.getItemId() == R.id.selection_mode_copy_link) {
184 recordUserActionWithOptionalSearch("CopyLink"); 184 recordUserActionWithOptionalSearch("CopyLink");
185 Clipboard clipboard = new Clipboard(mActivity); 185 Clipboard.getInstance().setText(mSelectionDelegate.getSelectedItems( ).get(0).getUrl());
186 clipboard.setText(mSelectionDelegate.getSelectedItems().get(0).getUr l());
187 mSelectionDelegate.clearSelection(); 186 mSelectionDelegate.clearSelection();
188 Snackbar snackbar = Snackbar.make(mActivity.getString(R.string.copie d), this, 187 Snackbar snackbar = Snackbar.make(mActivity.getString(R.string.copie d), this,
189 Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_HISTORY_LINK_COPIED ); 188 Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_HISTORY_LINK_COPIED );
190 ((SnackbarManageable) mActivity).getSnackbarManager().showSnackbar(s nackbar); 189 ((SnackbarManageable) mActivity).getSnackbarManager().showSnackbar(s nackbar);
191 return true; 190 return true;
192 } else if (item.getItemId() == R.id.selection_mode_open_in_incognito) { 191 } else if (item.getItemId() == R.id.selection_mode_open_in_incognito) {
193 openItemsInNewTabs(mSelectionDelegate.getSelectedItems(), true); 192 openItemsInNewTabs(mSelectionDelegate.getSelectedItems(), true);
194 mSelectionDelegate.clearSelection(); 193 mSelectionDelegate.clearSelection();
195 return true; 194 return true;
196 } else if (item.getItemId() == R.id.selection_mode_delete_menu_id) { 195 } else if (item.getItemId() == R.id.selection_mode_delete_menu_id) {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 @Override 428 @Override
430 public void onAction(Object actionData) { 429 public void onAction(Object actionData) {
431 // Handler for the link copied snackbar. Do nothing. 430 // Handler for the link copied snackbar. Do nothing.
432 } 431 }
433 432
434 @Override 433 @Override
435 public void onDismissNoAction(Object actionData) { 434 public void onDismissNoAction(Object actionData) {
436 // Handler for the link copied snackbar. Do nothing. 435 // Handler for the link copied snackbar. Do nothing.
437 } 436 }
438 } 437 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698