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.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.res.Configuration; | 9 import android.content.res.Configuration; |
10 import android.util.AttributeSet; | 10 import android.util.AttributeSet; |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 mAddButton = (ImageButton) findViewById(R.id.add_button); | 251 mAddButton = (ImageButton) findViewById(R.id.add_button); |
252 mAddButton.setOnClickListener(new OnClickListener() { | 252 mAddButton.setOnClickListener(new OnClickListener() { |
253 @Override | 253 @Override |
254 public void onClick(View v) { | 254 public void onClick(View v) { |
255 mTabManager.createNewTab(); | 255 mTabManager.createNewTab(); |
256 } | 256 } |
257 }); | 257 }); |
258 } | 258 } |
259 | 259 |
260 /** | 260 /** |
261 * Shows or hides the add and the stop/reload button. | 261 * Shows or hides the add button, the stop/reload button and the Url bar. |
Bernhard Bauer
2015/02/13 09:41:25
URL is spelled in all uppercase letters.
| |
262 */ | 262 */ |
263 public void updateToolBarButtonState() { | 263 public void updateToolbarState() { |
264 boolean tabSwitcherState = mTabManager.isTabSwitcherVisible(); | 264 boolean tabSwitcherState = mTabManager.isTabSwitcherVisible(); |
265 mAddButton.setVisibility(tabSwitcherState ? VISIBLE : GONE); | 265 mAddButton.setVisibility(tabSwitcherState ? VISIBLE : GONE); |
266 mStopReloadButton.setVisibility(tabSwitcherState || mFocus ? GONE : VISI BLE); | 266 mStopReloadButton.setVisibility(tabSwitcherState || mFocus ? GONE : VISI BLE); |
267 mUrlTextView.setVisibility(tabSwitcherState ? INVISIBLE : VISIBLE); | |
267 } | 268 } |
268 | 269 |
269 /** | 270 /** |
270 * @return Current tab that is shown by ChromeShell. | 271 * @return Current tab that is shown by ChromeShell. |
271 */ | 272 */ |
272 public ChromeShellTab getCurrentTab() { | 273 public ChromeShellTab getCurrentTab() { |
273 return mTab; | 274 return mTab; |
274 } | 275 } |
275 | 276 |
276 /** | 277 /** |
(...skipping 21 matching lines...) Expand all Loading... | |
298 public void onLoadProgressChanged(Tab tab, int progress) { | 299 public void onLoadProgressChanged(Tab tab, int progress) { |
299 if (tab == mTab) ChromeShellToolbar.this.onLoadProgressChanged(progr ess); | 300 if (tab == mTab) ChromeShellToolbar.this.onLoadProgressChanged(progr ess); |
300 } | 301 } |
301 | 302 |
302 @Override | 303 @Override |
303 public void onUpdateUrl(Tab tab, String url) { | 304 public void onUpdateUrl(Tab tab, String url) { |
304 if (tab == mTab) ChromeShellToolbar.this.onUpdateUrl(url); | 305 if (tab == mTab) ChromeShellToolbar.this.onUpdateUrl(url); |
305 } | 306 } |
306 } | 307 } |
307 } | 308 } |
OLD | NEW |