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

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 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 @Override 50 @Override
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 if (mTabModelSelector.getCurrentModel().getCount() == 1)
Bernhard Bauer 2014/11/19 15:51:18 You can only leave out braces if everything fits o
divya.bansal 2014/11/20 03:54:14 Done.
61 createNewTab();
60 } 62 }
61 }; 63 };
62 64
63 /** 65 /**
64 * @param context The Context the view is running in. 66 * @param context The Context the view is running in.
65 * @param attrs The attributes of the XML tag that is inflating the view. 67 * @param attrs The attributes of the XML tag that is inflating the view.
66 */ 68 */
67 public TabManager(Context context, AttributeSet attrs) { 69 public TabManager(Context context, AttributeSet attrs) {
68 super(context, attrs); 70 super(context, attrs);
69 } 71 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 LoadUrlParams loadUrlParams = new LoadUrlParams(url); 251 LoadUrlParams loadUrlParams = new LoadUrlParams(url);
250 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR OM_ADDRESS_BAR); 252 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR OM_ADDRESS_BAR);
251 Tab tab = mTabModelSelector.getCurrentTab(); 253 Tab tab = mTabModelSelector.getCurrentTab();
252 if (tab != null) { 254 if (tab != null) {
253 tab.loadUrl(loadUrlParams); 255 tab.loadUrl(loadUrlParams);
254 return tab; 256 return tab;
255 } 257 }
256 return createTab(url, TabLaunchType.FROM_KEYBOARD); 258 return createTab(url, TabLaunchType.FROM_KEYBOARD);
257 } 259 }
258 } 260 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698