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

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

Issue 1216853005: Fix theme inconsistencies for WebViews used in dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Catch a more specific exception. Created 5 years, 5 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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; 5 package org.chromium.content.browser;
6 6
7 import android.content.ClipboardManager; 7 import android.content.ClipboardManager;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.res.Resources;
9 import android.graphics.Rect; 10 import android.graphics.Rect;
10 import android.view.ActionMode; 11 import android.view.ActionMode;
11 import android.view.Menu; 12 import android.view.Menu;
12 import android.view.MenuInflater; 13 import android.view.MenuInflater;
13 import android.view.MenuItem; 14 import android.view.MenuItem;
14 import android.view.View; 15 import android.view.View;
15 16
16 import org.chromium.content.R; 17 import org.chromium.content.R;
17 18
18 /** 19 /**
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 mIsPasswordType = isPasswordNow; 136 mIsPasswordType = isPasswordNow;
136 mIsInsertion = isInsertionNow; 137 mIsInsertion = isInsertionNow;
137 menu.clear(); 138 menu.clear();
138 createActionMenu(mode, menu); 139 createActionMenu(mode, menu);
139 return true; 140 return true;
140 } 141 }
141 return false; 142 return false;
142 } 143 }
143 144
144 private void createActionMenu(ActionMode mode, Menu menu) { 145 private void createActionMenu(ActionMode mode, Menu menu) {
145 new MenuInflater(getContext()).inflate(R.menu.select_action_menu, menu); 146 try {
147 mode.getMenuInflater().inflate(R.menu.select_action_menu, menu);
148 } catch (Resources.NotFoundException e) {
149 // TODO(tobiasjs) by the time we get here we have already
150 // caused a resource loading failure to be logged. WebView
151 // resource access needs to be improved so that this
152 // logspam can be avoided.
153 new MenuInflater(getContext()).inflate(R.menu.select_action_menu, me nu);
154 }
146 155
147 if (mIsInsertion) { 156 if (mIsInsertion) {
148 menu.removeItem(R.id.select_action_menu_select_all); 157 menu.removeItem(R.id.select_action_menu_select_all);
149 menu.removeItem(R.id.select_action_menu_cut); 158 menu.removeItem(R.id.select_action_menu_cut);
150 menu.removeItem(R.id.select_action_menu_copy); 159 menu.removeItem(R.id.select_action_menu_copy);
151 menu.removeItem(R.id.select_action_menu_share); 160 menu.removeItem(R.id.select_action_menu_share);
152 menu.removeItem(R.id.select_action_menu_web_search); 161 menu.removeItem(R.id.select_action_menu_web_search);
153 return; 162 return;
154 } 163 }
155 164
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 public void onGetContentRect(ActionMode mode, View view, Rect outRect) { 228 public void onGetContentRect(ActionMode mode, View view, Rect outRect) {
220 mActionHandler.onGetContentRect(outRect); 229 mActionHandler.onGetContentRect(outRect);
221 } 230 }
222 231
223 private boolean canPaste() { 232 private boolean canPaste() {
224 ClipboardManager clipMgr = (ClipboardManager) 233 ClipboardManager clipMgr = (ClipboardManager)
225 getContext().getSystemService(Context.CLIPBOARD_SERVICE); 234 getContext().getSystemService(Context.CLIPBOARD_SERVICE);
226 return clipMgr.hasPrimaryClip(); 235 return clipMgr.hasPrimaryClip();
227 } 236 }
228 } 237 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698