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.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.os.Bundle; | 9 import android.os.Bundle; |
10 import android.text.TextUtils; | 10 import android.text.TextUtils; |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 public void createTab(String url) { | 274 public void createTab(String url) { |
275 mTabManager.createTab(url); | 275 mTabManager.createTab(url); |
276 } | 276 } |
277 | 277 |
278 /** | 278 /** |
279 * Override the menu key event to show AppMenu. | 279 * Override the menu key event to show AppMenu. |
280 */ | 280 */ |
281 @Override | 281 @Override |
282 public boolean onKeyDown(int keyCode, KeyEvent event) { | 282 public boolean onKeyDown(int keyCode, KeyEvent event) { |
283 if (keyCode == KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) { | 283 if (keyCode == KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) { |
284 if (mToolbar != null) mToolbar.hideSuggestions(); | |
Bernhard Bauer
2014/09/10 13:36:55
If this is the desired behavior (see bug), could w
| |
284 mAppMenuHandler.showAppMenu(findViewById(R.id.menu_button), true, fa lse); | 285 mAppMenuHandler.showAppMenu(findViewById(R.id.menu_button), true, fa lse); |
285 return true; | 286 return true; |
286 } | 287 } |
287 return super.onKeyDown(keyCode, event); | 288 return super.onKeyDown(keyCode, event); |
288 } | 289 } |
289 | 290 |
290 @SuppressWarnings("deprecation") | 291 @SuppressWarnings("deprecation") |
291 @Override | 292 @Override |
292 public boolean onOptionsItemSelected(MenuItem item) { | 293 public boolean onOptionsItemSelected(MenuItem item) { |
293 ChromeShellTab activeTab = getActiveTab(); | 294 ChromeShellTab activeTab = getActiveTab(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
400 @VisibleForTesting | 401 @VisibleForTesting |
401 public static void setActivityWindowAndroidFactory(ActivityWindowAndroidFact ory factory) { | 402 public static void setActivityWindowAndroidFactory(ActivityWindowAndroidFact ory factory) { |
402 sWindowAndroidFactory = factory; | 403 sWindowAndroidFactory = factory; |
403 } | 404 } |
404 | 405 |
405 @VisibleForTesting | 406 @VisibleForTesting |
406 public static void setAppMenuHandlerFactory(AppMenuHandlerFactory factory) { | 407 public static void setAppMenuHandlerFactory(AppMenuHandlerFactory factory) { |
407 sAppMenuHandlerFactory = factory; | 408 sAppMenuHandlerFactory = factory; |
408 } | 409 } |
409 } | 410 } |
OLD | NEW |