| OLD | NEW |
| 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.chrome.browser; | 5 package org.chromium.chrome.browser; |
| 6 | 6 |
| 7 import android.view.KeyEvent; | 7 import android.view.KeyEvent; |
| 8 | 8 |
| 9 import org.chromium.base.annotations.SuppressFBWarnings; | 9 import org.chromium.base.annotations.SuppressFBWarnings; |
| 10 import org.chromium.chrome.R; | 10 import org.chromium.chrome.R; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 return false; | 116 return false; |
| 117 } | 117 } |
| 118 | 118 |
| 119 TabModel curModel = activity.getCurrentTabModel(); | 119 TabModel curModel = activity.getCurrentTabModel(); |
| 120 int count = curModel.getCount(); | 120 int count = curModel.getCount(); |
| 121 | 121 |
| 122 int metaState = getMetaState(event); | 122 int metaState = getMetaState(event); |
| 123 int keyCodeAndMeta = keyCode | metaState; | 123 int keyCodeAndMeta = keyCode | metaState; |
| 124 | 124 |
| 125 switch (keyCodeAndMeta) { | 125 switch (keyCodeAndMeta) { |
| 126 case CTRL | SHIFT | KeyEvent.KEYCODE_T: |
| 127 if (!curModel.isIncognito()) { |
| 128 activity.onMenuOrKeyboardAction(R.id.open_recent_closed_tab,
false); |
| 129 } |
| 130 return true; |
| 126 case CTRL | KeyEvent.KEYCODE_T: | 131 case CTRL | KeyEvent.KEYCODE_T: |
| 127 activity.onMenuOrKeyboardAction(curModel.isIncognito() | 132 activity.onMenuOrKeyboardAction(curModel.isIncognito() |
| 128 ? R.id.new_incognito_tab_menu_id | 133 ? R.id.new_incognito_tab_menu_id |
| 129 : R.id.new_tab_menu_id, false); | 134 : R.id.new_tab_menu_id, false); |
| 130 return true; | 135 return true; |
| 131 case CTRL | KeyEvent.KEYCODE_N: | 136 case CTRL | KeyEvent.KEYCODE_N: |
| 132 activity.onMenuOrKeyboardAction(R.id.new_tab_menu_id, false); | 137 activity.onMenuOrKeyboardAction(R.id.new_tab_menu_id, false); |
| 133 return true; | 138 return true; |
| 134 case CTRL | SHIFT | KeyEvent.KEYCODE_N: | 139 case CTRL | SHIFT | KeyEvent.KEYCODE_N: |
| 135 activity.onMenuOrKeyboardAction(R.id.new_incognito_tab_menu_id,
false); | 140 activity.onMenuOrKeyboardAction(R.id.new_incognito_tab_menu_id,
false); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 return true; | 256 return true; |
| 252 case CTRL | SHIFT | KeyEvent.KEYCODE_SLASH: // i.e. Ctrl+? | 257 case CTRL | SHIFT | KeyEvent.KEYCODE_SLASH: // i.e. Ctrl+? |
| 253 activity.onMenuOrKeyboardAction(R.id.help_id, false); | 258 activity.onMenuOrKeyboardAction(R.id.help_id, false); |
| 254 return true; | 259 return true; |
| 255 } | 260 } |
| 256 } | 261 } |
| 257 | 262 |
| 258 return false; | 263 return false; |
| 259 } | 264 } |
| 260 } | 265 } |
| OLD | NEW |