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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/input/FloatingPastePopupMenu.java

Issue 2847523002: Android: Remove GetApplicationContext part 4 (Closed)
Patch Set: Rebase and fix build Created 3 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.content.browser.input; 5 package org.chromium.content.browser.input;
6 6
7 import android.annotation.TargetApi; 7 import android.annotation.TargetApi;
8 import android.content.Context; 8 import android.content.Context;
9 import android.graphics.Rect; 9 import android.graphics.Rect;
10 import android.os.Build; 10 import android.os.Build;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 private class ActionModeCallback extends ActionMode.Callback2 { 73 private class ActionModeCallback extends ActionMode.Callback2 {
74 @Override 74 @Override
75 public boolean onCreateActionMode(ActionMode mode, Menu menu) { 75 public boolean onCreateActionMode(ActionMode mode, Menu menu) {
76 createPasteMenu(mode, menu); 76 createPasteMenu(mode, menu);
77 return true; 77 return true;
78 } 78 }
79 79
80 private void createPasteMenu(ActionMode mode, Menu menu) { 80 private void createPasteMenu(ActionMode mode, Menu menu) {
81 mode.setTitle(DeviceFormFactor.isTablet(mContext) 81 mode.setTitle(DeviceFormFactor.isTablet()
82 ? mContext.getString(R.string.actionbar_textselection_title) : null); 82 ? mContext.getString(R.string.actionbar_textselectio n_title)
83 : null);
83 mode.setSubtitle(null); 84 mode.setSubtitle(null);
84 SelectionPopupController.initializeMenu(mContext, mode, menu); 85 SelectionPopupController.initializeMenu(mContext, mode, menu);
85 if (!mDelegate.canPaste()) menu.removeItem(R.id.select_action_menu_p aste); 86 if (!mDelegate.canPaste()) menu.removeItem(R.id.select_action_menu_p aste);
86 if (!mDelegate.canSelectAll()) menu.removeItem(R.id.select_action_me nu_select_all); 87 if (!mDelegate.canSelectAll()) menu.removeItem(R.id.select_action_me nu_select_all);
87 if (!mDelegate.canPasteAsPlainText()) { 88 if (!mDelegate.canPasteAsPlainText()) {
88 menu.removeItem(R.id.select_action_menu_paste_as_plain_text); 89 menu.removeItem(R.id.select_action_menu_paste_as_plain_text);
89 } 90 }
90 // TODO(ctzsm): Remove runtime title set after O SDK rolls. 91 // TODO(ctzsm): Remove runtime title set after O SDK rolls.
91 MenuItem item = menu.findItem(R.id.select_action_menu_paste_as_plain _text); 92 MenuItem item = menu.findItem(R.id.select_action_menu_paste_as_plain _text);
92 if (item != null) { 93 if (item != null) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 public void onDestroyActionMode(ActionMode mode) { 127 public void onDestroyActionMode(ActionMode mode) {
127 mActionMode = null; 128 mActionMode = null;
128 } 129 }
129 130
130 @Override 131 @Override
131 public void onGetContentRect(ActionMode mode, View view, Rect outRect) { 132 public void onGetContentRect(ActionMode mode, View view, Rect outRect) {
132 outRect.set(mSelectionRect); 133 outRect.set(mSelectionRect);
133 } 134 }
134 }; 135 };
135 } 136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698