OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.shell; | 5 package org.chromium.chrome.shell; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.res.Configuration; | 9 import android.content.res.Configuration; |
10 import android.graphics.drawable.ClipDrawable; | 10 import android.graphics.drawable.ClipDrawable; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 @Override | 158 @Override |
159 public boolean onEditorAction(TextView v, int actionId, KeyEvent eve nt) { | 159 public boolean onEditorAction(TextView v, int actionId, KeyEvent eve nt) { |
160 if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null | 160 if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null |
161 || event.getKeyCode() != KeyEvent.KEYCODE_ENTER | 161 || event.getKeyCode() != KeyEvent.KEYCODE_ENTER |
162 || event.getAction() != KeyEvent.ACTION_DOWN)) { | 162 || event.getAction() != KeyEvent.ACTION_DOWN)) { |
163 return false; | 163 return false; |
164 } | 164 } |
165 | 165 |
166 // This will set |mTab| by calling showTab(). | 166 // This will set |mTab| by calling showTab(). |
167 // TODO(aurimas): Factor out initial tab creation to the activit y level. | 167 // TODO(aurimas): Factor out initial tab creation to the activit y level. |
168 if (mTabManager.isTabSwitcherVisible()) { | |
Bernhard Bauer
2014/11/07 11:02:39
This should come before the comment, as the commen
divya.bansal
2014/11/07 11:38:33
Done.
| |
169 mTabManager.hideTabSwitcher(); | |
170 } | |
168 Tab tab = mTabManager.openUrl( | 171 Tab tab = mTabManager.openUrl( |
169 UrlUtilities.fixupUrl(mUrlTextView.getText().toString()) ); | 172 UrlUtilities.fixupUrl(mUrlTextView.getText().toString()) ); |
170 mUrlTextView.clearFocus(); | 173 mUrlTextView.clearFocus(); |
171 setKeyboardVisibilityForUrl(false); | 174 setKeyboardVisibilityForUrl(false); |
172 tab.getView().requestFocus(); | 175 tab.getView().requestFocus(); |
173 return true; | 176 return true; |
174 } | 177 } |
175 }); | 178 }); |
176 mUrlTextView.setOnFocusChangeListener(new OnFocusChangeListener() { | 179 mUrlTextView.setOnFocusChangeListener(new OnFocusChangeListener() { |
177 @Override | 180 @Override |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
276 public void onLoadProgressChanged(Tab tab, int progress) { | 279 public void onLoadProgressChanged(Tab tab, int progress) { |
277 if (tab == mTab) ChromeShellToolbar.this.onLoadProgressChanged(progr ess); | 280 if (tab == mTab) ChromeShellToolbar.this.onLoadProgressChanged(progr ess); |
278 } | 281 } |
279 | 282 |
280 @Override | 283 @Override |
281 public void onUpdateUrl(Tab tab, String url) { | 284 public void onUpdateUrl(Tab tab, String url) { |
282 if (tab == mTab) ChromeShellToolbar.this.onUpdateUrl(url); | 285 if (tab == mTab) ChromeShellToolbar.this.onUpdateUrl(url); |
283 } | 286 } |
284 } | 287 } |
285 } | 288 } |
OLD | NEW |