| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 contentViewCore.onShow(); | 183 contentViewCore.onShow(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 /** | 186 /** |
| 187 * Toggles the tab switcher visibility. | 187 * Toggles the tab switcher visibility. |
| 188 */ | 188 */ |
| 189 public void toggleTabSwitcher() { | 189 public void toggleTabSwitcher() { |
| 190 mTabModelSelector.toggleTabSwitcher(); | 190 mTabModelSelector.toggleTabSwitcher(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 public boolean isTabSwitcherVisible() { |
| 194 return mTabModelSelector.isTabSwitcherVisible(); |
| 195 } |
| 196 |
| 197 public void hideTabSwitcher() { |
| 198 mTabModelSelector.hideTabSwitcher(); |
| 199 } |
| 200 |
| 193 /** | 201 /** |
| 194 * Opens a URL in the current tab if one exists, or in a new tab otherwise. | 202 * Opens a URL in the current tab if one exists, or in a new tab otherwise. |
| 195 * @param url The URL to open. | 203 * @param url The URL to open. |
| 196 * @return The tab used to open the provided URL. | 204 * @return The tab used to open the provided URL. |
| 197 */ | 205 */ |
| 198 public Tab openUrl(String url) { | 206 public Tab openUrl(String url) { |
| 199 LoadUrlParams loadUrlParams = new LoadUrlParams(url); | 207 LoadUrlParams loadUrlParams = new LoadUrlParams(url); |
| 200 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR
OM_ADDRESS_BAR); | 208 loadUrlParams.setTransitionType(PageTransition.TYPED | PageTransition.FR
OM_ADDRESS_BAR); |
| 201 Tab tab = mTabModelSelector.getCurrentTab(); | 209 Tab tab = mTabModelSelector.getCurrentTab(); |
| 202 if (tab != null) { | 210 if (tab != null) { |
| 203 tab.loadUrl(loadUrlParams); | 211 tab.loadUrl(loadUrlParams); |
| 204 return tab; | 212 return tab; |
| 205 } | 213 } |
| 206 return createTab(url, TabLaunchType.FROM_KEYBOARD); | 214 return createTab(url, TabLaunchType.FROM_KEYBOARD); |
| 207 } | 215 } |
| 208 } | 216 } |
| OLD | NEW |