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

Side by Side Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java

Issue 738693002: Opening new "about:blank" tab if all tabs are closed in tab switcher mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 mTabManager.createTab(url, TabLaunchType.FROM_EXTERNAL_APP); 287 mTabManager.createTab(url, TabLaunchType.FROM_EXTERNAL_APP);
288 } 288 }
289 289
290 /** 290 /**
291 * Closes all current tabs. 291 * Closes all current tabs.
292 */ 292 */
293 public void closeAllTabs() { 293 public void closeAllTabs() {
294 mTabManager.closeAllTabs(); 294 mTabManager.closeAllTabs();
295 } 295 }
296 296
297 @VisibleForTesting
298 public void closeTab() {
299 mTabManager.closeTab();
300 }
301
297 /** 302 /**
298 * Override the menu key event to show AppMenu. 303 * Override the menu key event to show AppMenu.
299 */ 304 */
300 @Override 305 @Override
301 public boolean onKeyDown(int keyCode, KeyEvent event) { 306 public boolean onKeyDown(int keyCode, KeyEvent event) {
302 if (keyCode == KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) { 307 if (keyCode == KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) {
303 if (mToolbar != null) mToolbar.hideSuggestions(); 308 if (mToolbar != null) mToolbar.hideSuggestions();
304 mAppMenuHandler.showAppMenu(findViewById(R.id.menu_button), true, fa lse); 309 mAppMenuHandler.showAppMenu(findViewById(R.id.menu_button), true, fa lse);
305 return true; 310 return true;
306 } 311 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 @VisibleForTesting 438 @VisibleForTesting
434 public static void setActivityWindowAndroidFactory(ActivityWindowAndroidFact ory factory) { 439 public static void setActivityWindowAndroidFactory(ActivityWindowAndroidFact ory factory) {
435 sWindowAndroidFactory = factory; 440 sWindowAndroidFactory = factory;
436 } 441 }
437 442
438 @VisibleForTesting 443 @VisibleForTesting
439 public static void setAppMenuHandlerFactory(AppMenuHandlerFactory factory) { 444 public static void setAppMenuHandlerFactory(AppMenuHandlerFactory factory) {
440 sAppMenuHandlerFactory = factory; 445 sAppMenuHandlerFactory = factory;
441 } 446 }
442 } 447 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698