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

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

Issue 683203006: Adding option for adding new tab in tab manager for chrome shell. (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
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.View; 9 import android.view.View;
10 import android.view.ViewGroup; 10 import android.view.ViewGroup;
(...skipping 15 matching lines...) Expand all
26 /** 26 /**
27 * The TabManager hooks together all of the related {@link View}s that are used to represent 27 * The TabManager hooks together all of the related {@link View}s that are used to represent
28 * a {@link ChromeShellTab}. It properly builds a {@link ChromeShellTab} and ma kes sure that the 28 * a {@link ChromeShellTab}. It properly builds a {@link ChromeShellTab} and ma kes sure that the
29 * {@link ChromeShellToolbar} and {@link ContentViewRenderView} show the proper content. 29 * {@link ChromeShellToolbar} and {@link ContentViewRenderView} show the proper content.
30 */ 30 */
31 public class TabManager extends LinearLayout { 31 public class TabManager extends LinearLayout {
32 private static final String DEFAULT_URL = "http://www.google.com"; 32 private static final String DEFAULT_URL = "http://www.google.com";
33 33
34 private ViewGroup mContentViewHolder; 34 private ViewGroup mContentViewHolder;
35 private ContentViewRenderView mContentViewRenderView; 35 private ContentViewRenderView mContentViewRenderView;
36 private ChromeShellToolbar mToolbar; 36 public ChromeShellToolbar mToolbar;
Bernhard Bauer 2014/11/05 10:01:53 Don't make member variables public, add a getter m
37 37
38 private ChromeShellTab mCurrentTab; 38 private ChromeShellTab mCurrentTab;
39 39
40 private String mStartupUrl = DEFAULT_URL; 40 private String mStartupUrl = DEFAULT_URL;
41 41
42 private ChromeShellTabModelSelector mTabModelSelector; 42 private ChromeShellTabModelSelector mTabModelSelector;
43 43
44 private final EmptyTabModelObserver mTabModelObserver = new EmptyTabModelObs erver() { 44 private final EmptyTabModelObserver mTabModelObserver = new EmptyTabModelObs erver() {
45 @Override 45 @Override
46 public void didSelectTab(Tab tab, TabSelectionType type, int lastId) { 46 public void didSelectTab(Tab tab, TabSelectionType type, int lastId) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 LoadUrlParams loadUrlParams = new LoadUrlParams(url); 207 LoadUrlParams loadUrlParams = new LoadUrlParams(url);
208 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR OM_ADDRESS_BAR); 208 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR OM_ADDRESS_BAR);
209 Tab tab = mTabModelSelector.getCurrentTab(); 209 Tab tab = mTabModelSelector.getCurrentTab();
210 if (tab != null) { 210 if (tab != null) {
211 tab.loadUrl(loadUrlParams); 211 tab.loadUrl(loadUrlParams);
212 return tab; 212 return tab;
213 } 213 }
214 return createTab(url, TabLaunchType.FROM_KEYBOARD); 214 return createTab(url, TabLaunchType.FROM_KEYBOARD);
215 } 215 }
216 } 216 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698