OLD | NEW |
---|---|
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 * @param videoViewClient The client to handle interactions from ContentVide oViews. | 69 * @param videoViewClient The client to handle interactions from ContentVide oViews. |
70 */ | 70 */ |
71 public void initialize(WindowAndroid window, ContentVideoViewClient videoVie wClient) { | 71 public void initialize(WindowAndroid window, ContentVideoViewClient videoVie wClient) { |
72 assert window != null; | 72 assert window != null; |
73 assert videoViewClient != null; | 73 assert videoViewClient != null; |
74 | 74 |
75 mContentViewHolder = (ViewGroup) findViewById(R.id.content_container); | 75 mContentViewHolder = (ViewGroup) findViewById(R.id.content_container); |
76 | 76 |
77 mTabModelSelector = new ChromeShellTabModelSelector( | 77 mTabModelSelector = new ChromeShellTabModelSelector( |
78 window, videoViewClient, mContentViewHolder); | 78 window, videoViewClient, mContentViewHolder); |
79 mTabModelSelector.setTabManager(this); | |
Bernhard Bauer
2014/10/30 13:41:35
Any reason you're using a mutator here instead of
ankit
2014/10/30 14:16:46
I just thought if ChromeShellTabModelSelector is c
Bernhard Bauer
2014/10/31 11:22:36
Eh. I would rather allow ChromeShellTabModelSelect
| |
79 mTabModelSelector.getModel(false).addObserver(mTabModelObserver); | 80 mTabModelSelector.getModel(false).addObserver(mTabModelObserver); |
80 | 81 |
81 mToolbar = (ChromeShellToolbar) findViewById(R.id.toolbar); | 82 mToolbar = (ChromeShellToolbar) findViewById(R.id.toolbar); |
82 mToolbar.setTabManager(this); | 83 mToolbar.setTabManager(this); |
83 mContentViewRenderView = new ContentViewRenderView(getContext()) { | 84 mContentViewRenderView = new ContentViewRenderView(getContext()) { |
84 @Override | 85 @Override |
85 protected void onReadyToRender() { | 86 protected void onReadyToRender() { |
86 if (mCurrentTab == null) createTab(mStartupUrl, TabLaunchType.FR OM_RESTORE); | 87 if (mCurrentTab == null) createTab(mStartupUrl, TabLaunchType.FR OM_RESTORE); |
87 } | 88 } |
88 }; | 89 }; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 LoadUrlParams loadUrlParams = new LoadUrlParams(url); | 200 LoadUrlParams loadUrlParams = new LoadUrlParams(url); |
200 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR OM_ADDRESS_BAR); | 201 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR OM_ADDRESS_BAR); |
201 Tab tab = mTabModelSelector.getCurrentTab(); | 202 Tab tab = mTabModelSelector.getCurrentTab(); |
202 if (tab != null) { | 203 if (tab != null) { |
203 tab.loadUrl(loadUrlParams); | 204 tab.loadUrl(loadUrlParams); |
204 return tab; | 205 return tab; |
205 } | 206 } |
206 return createTab(url, TabLaunchType.FROM_KEYBOARD); | 207 return createTab(url, TabLaunchType.FROM_KEYBOARD); |
207 } | 208 } |
208 } | 209 } |
OLD | NEW |