OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.browser.toolbar; | 5 package org.chromium.chrome.browser.toolbar; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.res.Configuration; | 8 import android.content.res.Configuration; |
9 import android.graphics.drawable.Drawable; | 9 import android.graphics.drawable.Drawable; |
10 import android.os.Handler; | 10 import android.os.Handler; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 }; | 195 }; |
196 | 196 |
197 mToolbarModel = new ToolbarModelImpl(); | 197 mToolbarModel = new ToolbarModelImpl(); |
198 mControlContainer = controlContainer; | 198 mControlContainer = controlContainer; |
199 assert mControlContainer != null; | 199 assert mControlContainer != null; |
200 | 200 |
201 mToolbar = (ToolbarLayout) controlContainer.findViewById(R.id.toolbar); | 201 mToolbar = (ToolbarLayout) controlContainer.findViewById(R.id.toolbar); |
202 | 202 |
203 mToolbar.setPaintInvalidator(invalidator); | 203 mToolbar.setPaintInvalidator(invalidator); |
204 mToolbar.setBottomSheet(activity.getBottomSheet()); | 204 if (activity.getBottomSheet() != null) mToolbar.setBottomSheet(activity.
getBottomSheet()); |
205 | 205 |
206 mActionModeController = new ActionModeController(activity, mActionBarDel
egate); | 206 mActionModeController = new ActionModeController(activity, mActionBarDel
egate); |
207 mActionModeController.setCustomSelectionActionModeCallback( | 207 mActionModeController.setCustomSelectionActionModeCallback( |
208 new ToolbarActionModeCallback()); | 208 new ToolbarActionModeCallback()); |
209 mActionModeController.setTabStripHeight(mToolbar.getTabStripHeight()); | 209 mActionModeController.setTabStripHeight(mToolbar.getTabStripHeight()); |
210 | 210 |
211 MenuDelegatePhone menuDelegate = new MenuDelegatePhone() { | 211 MenuDelegatePhone menuDelegate = new MenuDelegatePhone() { |
212 @Override | 212 @Override |
213 public void updateReloadButtonState(boolean isLoading) { | 213 public void updateReloadButtonState(boolean isLoading) { |
214 if (mAppMenuPropertiesDelegate != null) { | 214 if (mAppMenuPropertiesDelegate != null) { |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 } | 1250 } |
1251 | 1251 |
1252 /** | 1252 /** |
1253 * Cancels simulating load progress. | 1253 * Cancels simulating load progress. |
1254 */ | 1254 */ |
1255 public void cancel() { | 1255 public void cancel() { |
1256 mHandler.removeMessages(MSG_ID_UPDATE_PROGRESS); | 1256 mHandler.removeMessages(MSG_ID_UPDATE_PROGRESS); |
1257 } | 1257 } |
1258 } | 1258 } |
1259 } | 1259 } |
OLD | NEW |