Chromium Code Reviews| 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.view.LayoutInflater; | 7 import android.view.LayoutInflater; |
| 8 import android.view.ViewGroup; | 8 import android.view.ViewGroup; |
| 9 import android.view.ViewParent; | 9 import android.view.ViewParent; |
| 10 | 10 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 } else { | 113 } else { |
| 114 hideTabSwitcher(); | 114 hideTabSwitcher(); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 /* | 118 /* |
| 119 * Hide the tab switcher. | 119 * Hide the tab switcher. |
| 120 */ | 120 */ |
| 121 public void hideTabSwitcher() { | 121 public void hideTabSwitcher() { |
| 122 if (mTabModelWrapper == null) return; | 122 if (mTabModelWrapper == null) return; |
| 123 mTabManager.mToolbar.initializeAddButton(false); | |
|
Bernhard Bauer
2014/11/05 10:01:53
Hmm... the encapsulation violation here aside, I'm
divya.bansal
2014/11/05 12:22:17
AccessibilityTabModelWrapper implements TabModelSe
Bernhard Bauer
2014/11/05 12:36:03
Why is it a problem that AccessibilityTabModelWrap
divya.bansal
2014/11/07 05:26:26
@Bernhard I have tried to implement this behaviour
divya.bansal
2014/11/10 13:49:59
Done. Made changes according to your suggestion. P
| |
| 123 ViewParent parent = mTabModelWrapper.getParent(); | 124 ViewParent parent = mTabModelWrapper.getParent(); |
| 124 if (parent != null) { | 125 if (parent != null) { |
| 125 assert parent == mParent; | 126 assert parent == mParent; |
| 126 mParent.removeView(mTabModelWrapper); | 127 mParent.removeView(mTabModelWrapper); |
| 127 } | 128 } |
| 128 } | 129 } |
| 129 | 130 |
| 130 private void showTabSwitcher() { | 131 private void showTabSwitcher() { |
| 131 if (mTabModelWrapper == null) { | 132 if (mTabModelWrapper == null) { |
| 132 mTabModelWrapper = (AccessibilityTabModelWrapper) LayoutInflater.fro m( | 133 mTabModelWrapper = (AccessibilityTabModelWrapper) LayoutInflater.fro m( |
| 133 mParent.getContext()).inflate(R.layout.accessibility_tab_swi tcher, null); | 134 mParent.getContext()).inflate(R.layout.accessibility_tab_swi tcher, null); |
| 134 mTabModelWrapper.setup(null); | 135 mTabModelWrapper.setup(null); |
| 135 mTabModelWrapper.setTabModelSelector(this); | 136 mTabModelWrapper.setTabModelSelector(this); |
| 136 } | 137 } |
| 137 | |
| 138 if (mTabModelWrapper.getParent() == null) { | 138 if (mTabModelWrapper.getParent() == null) { |
| 139 mParent.addView(mTabModelWrapper); | 139 mParent.addView(mTabModelWrapper); |
| 140 } | 140 } |
| 141 mTabManager.mToolbar.initializeAddButton(true); | |
| 141 } | 142 } |
| 142 | 143 |
| 143 public boolean isTabSwitcherVisible() { | 144 public boolean isTabSwitcherVisible() { |
| 144 return mTabModelWrapper != null && mTabModelWrapper.getParent() == mPare nt; | 145 return mTabModelWrapper != null && mTabModelWrapper.getParent() == mPare nt; |
| 145 } | 146 } |
| 146 | 147 |
| 147 } | 148 } |
| OLD | NEW |