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

Side by Side Diff: chrome/android/shell/java/src/org/chromium/chrome/shell/TabManager.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: Review comment changes 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.content.Context; 7 import android.content.Context;
8 import android.util.AttributeSet; 8 import android.util.AttributeSet;
9 import android.view.LayoutInflater; 9 import android.view.LayoutInflater;
10 import android.view.View; 10 import android.view.View;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 public void didSelectTab(Tab tab, TabSelectionType type, int lastId) { 51 public void didSelectTab(Tab tab, TabSelectionType type, int lastId) {
52 assert tab instanceof ChromeShellTab; 52 assert tab instanceof ChromeShellTab;
53 setCurrentTab((ChromeShellTab) tab); 53 setCurrentTab((ChromeShellTab) tab);
54 hideTabSwitcher(); 54 hideTabSwitcher();
55 } 55 }
56 56
57 @Override 57 @Override
58 public void willCloseTab(Tab tab, boolean animate) { 58 public void willCloseTab(Tab tab, boolean animate) {
59 if (tab == mCurrentTab) setCurrentTab(null); 59 if (tab == mCurrentTab) setCurrentTab(null);
60 } 60 }
61
62 @Override
63 public void didCloseTab(Tab tab) {
64 ensureTabExists();
65 }
66
61 }; 67 };
62 68
63 /** 69 /**
64 * @param context The Context the view is running in. 70 * @param context The Context the view is running in.
65 * @param attrs The attributes of the XML tag that is inflating the view. 71 * @param attrs The attributes of the XML tag that is inflating the view.
66 */ 72 */
67 public TabManager(Context context, AttributeSet attrs) { 73 public TabManager(Context context, AttributeSet attrs) {
68 super(context, attrs); 74 super(context, attrs);
69 } 75 }
70 76
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 LoadUrlParams loadUrlParams = new LoadUrlParams(url); 255 LoadUrlParams loadUrlParams = new LoadUrlParams(url);
250 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR OM_ADDRESS_BAR); 256 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR OM_ADDRESS_BAR);
251 Tab tab = mTabModelSelector.getCurrentTab(); 257 Tab tab = mTabModelSelector.getCurrentTab();
252 if (tab != null) { 258 if (tab != null) {
253 tab.loadUrl(loadUrlParams); 259 tab.loadUrl(loadUrlParams);
254 return tab; 260 return tab;
255 } 261 }
256 return createTab(url, TabLaunchType.FROM_KEYBOARD); 262 return createTab(url, TabLaunchType.FROM_KEYBOARD);
257 } 263 }
258 } 264 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698