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

Side by Side Diff: content/shell/android/java/src/org/chromium/content_shell/Shell.java

Issue 12093068: Adding missing UpdateTextInputState calls after each ime event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Ted's nits Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_widget.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_shell; 5 package org.chromium.content_shell;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.graphics.drawable.ClipDrawable; 8 import android.graphics.drawable.ClipDrawable;
9 import android.text.TextUtils; 9 import android.text.TextUtils;
10 import android.util.AttributeSet; 10 import android.util.AttributeSet;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 */ 139 */
140 public void loadUrl(String url) { 140 public void loadUrl(String url) {
141 if (url == null) return; 141 if (url == null) return;
142 142
143 if (TextUtils.equals(url, mContentView.getUrl())) { 143 if (TextUtils.equals(url, mContentView.getUrl())) {
144 mContentView.reload(); 144 mContentView.reload();
145 } else { 145 } else {
146 mContentView.loadUrl(new LoadUrlParams(sanitizeUrl(url))); 146 mContentView.loadUrl(new LoadUrlParams(sanitizeUrl(url)));
147 } 147 }
148 mUrlTextView.clearFocus(); 148 mUrlTextView.clearFocus();
149 // Remove this when crbug.com/174541 is fixed.
Ted C 2013/02/06 02:29:22 Make this // TODO(aurimas): Remove ...
150 mContentView.clearFocus();
151 mContentView.requestFocus();
149 } 152 }
150 153
151 /** 154 /**
152 * Given an URL, this performs minimal sanitizing to ensure it will be valid . 155 * Given an URL, this performs minimal sanitizing to ensure it will be valid .
153 * @param url The url to be sanitized. 156 * @param url The url to be sanitized.
154 * @return The sanitized URL. 157 * @return The sanitized URL.
155 */ 158 */
156 public static String sanitizeUrl(String url) { 159 public static String sanitizeUrl(String url) {
157 if (url == null) return url; 160 if (url == null) return url;
158 if (url.startsWith("www.") || url.indexOf(":") == -1) url = "http://" + url; 161 if (url.startsWith("www.") || url.indexOf(":") == -1) url = "http://" + url;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 private void setKeyboardVisibilityForUrl(boolean visible) { 237 private void setKeyboardVisibilityForUrl(boolean visible) {
235 InputMethodManager imm = (InputMethodManager) getContext().getSystemServ ice( 238 InputMethodManager imm = (InputMethodManager) getContext().getSystemServ ice(
236 Context.INPUT_METHOD_SERVICE); 239 Context.INPUT_METHOD_SERVICE);
237 if (visible) { 240 if (visible) {
238 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); 241 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT);
239 } else { 242 } else {
240 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); 243 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0);
241 } 244 }
242 } 245 }
243 } 246 }
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698