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.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.graphics.Canvas; | 10 import android.graphics.Canvas; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 257 |
258 @Override | 258 @Override |
259 public void setOnTabSwitcherClickHandler(OnClickListener listener) { } | 259 public void setOnTabSwitcherClickHandler(OnClickListener listener) { } |
260 | 260 |
261 @Override | 261 @Override |
262 public void setOnNewTabClickHandler(OnClickListener listener) { } | 262 public void setOnNewTabClickHandler(OnClickListener listener) { } |
263 | 263 |
264 @Override | 264 @Override |
265 public void setBookmarkClickHandler(OnClickListener listener) { } | 265 public void setBookmarkClickHandler(OnClickListener listener) { } |
266 | 266 |
267 @Override | 267 |
268 public void setCustomTabReturnClickHandler(OnClickListener listener) { } | 268 /** |
| 269 * Sets the OnClickListener to notify when the close button is pressed in a
custom tab. |
| 270 * @param listener The callback that will be notified when the close button
is pressed. |
| 271 */ |
| 272 public void setCustomTabCloseClickHandler(OnClickListener listener) { } |
269 | 273 |
270 /** | 274 /** |
271 * Gives inheriting classes the chance to update the visibility of the | 275 * Gives inheriting classes the chance to update the visibility of the |
272 * back button. | 276 * back button. |
273 * @param canGoBack Whether or not the current tab has any history to go bac
k to. | 277 * @param canGoBack Whether or not the current tab has any history to go bac
k to. |
274 */ | 278 */ |
275 protected void updateBackButtonVisibility(boolean canGoBack) { } | 279 protected void updateBackButtonVisibility(boolean canGoBack) { } |
276 | 280 |
277 /** | 281 /** |
278 * Gives inheriting classes the chance to update the visibility of the | 282 * Gives inheriting classes the chance to update the visibility of the |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 331 |
328 getLocationBar().updateMicButtonState(); | 332 getLocationBar().updateMicButtonState(); |
329 } | 333 } |
330 | 334 |
331 /** | 335 /** |
332 * For extending classes to override and carry out the changes related with
the primary color | 336 * For extending classes to override and carry out the changes related with
the primary color |
333 * for the current tab changing. | 337 * for the current tab changing. |
334 */ | 338 */ |
335 protected void onPrimaryColorChanged() { } | 339 protected void onPrimaryColorChanged() { } |
336 | 340 |
| 341 /** |
| 342 * Sets the icon resource that the close button in the toolbar (if any) shou
ld show. |
| 343 */ |
| 344 public void setCloseButtonIcon(int iconRes) { } |
| 345 |
337 @Override | 346 @Override |
338 public void addCustomActionButton(Bitmap buttonSource, OnClickListener liste
ner) { } | 347 public void addCustomActionButton(Bitmap buttonSource, OnClickListener liste
ner) { } |
339 | 348 |
340 /** | 349 /** |
341 * Triggered when the content view for the specified tab has changed. | 350 * Triggered when the content view for the specified tab has changed. |
342 */ | 351 */ |
343 protected void onTabContentViewChanged() { | 352 protected void onTabContentViewChanged() { |
344 NewTabPage ntp = getToolbarDataProvider().getNewTabPageForCurrentTab(); | 353 NewTabPage ntp = getToolbarDataProvider().getNewTabPageForCurrentTab(); |
345 if (ntp != null) getLocationBar().onTabLoadingNTP(ntp); | 354 if (ntp != null) getLocationBar().onTabLoadingNTP(ntp); |
346 } | 355 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } | 514 } |
506 | 515 |
507 /** | 516 /** |
508 * Opens hompage in the current tab. | 517 * Opens hompage in the current tab. |
509 */ | 518 */ |
510 protected void openHomepage() { | 519 protected void openHomepage() { |
511 getLocationBar().hideSuggestions(); | 520 getLocationBar().hideSuggestions(); |
512 if (mToolbarTabController != null) mToolbarTabController.openHomepage(); | 521 if (mToolbarTabController != null) mToolbarTabController.openHomepage(); |
513 } | 522 } |
514 } | 523 } |
OLD | NEW |