Chromium Code Reviews| 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.compositor.bottombar.contextualsearch; | 5 package org.chromium.chrome.browser.compositor.bottombar.contextualsearch; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.os.Handler; | 9 import android.os.Handler; |
| 10 | 10 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 /** | 376 /** |
| 377 * Called when the SERP finishes loading, this records the duration of loadi ng the SERP from | 377 * Called when the SERP finishes loading, this records the duration of loadi ng the SERP from |
| 378 * the time the panel was opened until the present. | 378 * the time the panel was opened until the present. |
| 379 * @param wasPrefetch Whether the request was prefetch-enabled. | 379 * @param wasPrefetch Whether the request was prefetch-enabled. |
| 380 */ | 380 */ |
| 381 public void onSearchResultsLoaded(boolean wasPrefetch) { | 381 public void onSearchResultsLoaded(boolean wasPrefetch) { |
| 382 mPanelMetrics.onSearchResultsLoaded(wasPrefetch); | 382 mPanelMetrics.onSearchResultsLoaded(wasPrefetch); |
| 383 } | 383 } |
| 384 | 384 |
| 385 /** | 385 /** |
| 386 * Notifies the panel that the Search Results are now viewable in the panel. | |
| 387 * @param didResolve Whether the search required Search Term Resolution. | |
| 388 */ | |
| 389 public void onSearchResultsViewable(boolean didResolve) { | |
|
pedro (no code reviews)
2016/02/26 22:30:09
Does this mean the results were viewed, or that th
Donn Denman
2016/02/27 00:18:39
Humm, onSearchResultsPrefetched seems confusing to
pedro (no code reviews)
2016/02/27 00:39:04
Good point. onPrefetchedSearchNavigated() seems go
| |
| 390 mPanelMetrics.onSearchResultsViewable(didResolve); | |
| 391 } | |
| 392 | |
| 393 /** | |
| 386 * Maximizes the Contextual Search Panel, then promotes it to a regular Tab. | 394 * Maximizes the Contextual Search Panel, then promotes it to a regular Tab. |
| 387 * @param reason The {@code StateChangeReason} behind the maximization and p romotion to tab. | 395 * @param reason The {@code StateChangeReason} behind the maximization and p romotion to tab. |
| 388 */ | 396 */ |
| 389 public void maximizePanelThenPromoteToTab(StateChangeReason reason) { | 397 public void maximizePanelThenPromoteToTab(StateChangeReason reason) { |
| 390 mShouldPromoteToTabAfterMaximizing = true; | 398 mShouldPromoteToTabAfterMaximizing = true; |
| 391 maximizePanel(reason); | 399 maximizePanel(reason); |
| 392 } | 400 } |
| 393 | 401 |
| 394 /** | 402 /** |
| 395 * Maximizes the Contextual Search Panel, then promotes it to a regular Tab. | 403 * Maximizes the Contextual Search Panel, then promotes it to a regular Tab. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 463 public void displaySearchContext(String selection, String end) { | 471 public void displaySearchContext(String selection, String end) { |
| 464 cancelSearchTermResolutionAnimation(); | 472 cancelSearchTermResolutionAnimation(); |
| 465 getSearchBarControl().setSearchContext(selection, end); | 473 getSearchBarControl().setSearchContext(selection, end); |
| 466 resetSearchBarContextOpacity(); | 474 resetSearchBarContextOpacity(); |
| 467 } | 475 } |
| 468 | 476 |
| 469 /** | 477 /** |
| 470 * Handles showing the resolved search term in the SearchBar. | 478 * Handles showing the resolved search term in the SearchBar. |
| 471 * @param searchTerm The string that represents the search term. | 479 * @param searchTerm The string that represents the search term. |
| 472 */ | 480 */ |
| 473 public void onSearchTermResolutionResponse(String searchTerm) { | 481 public void onSearchTermResolved(String searchTerm) { |
| 482 mPanelMetrics.onSearchTermResolved(); | |
| 474 getSearchBarControl().setSearchTerm(searchTerm); | 483 getSearchBarControl().setSearchTerm(searchTerm); |
| 475 animateSearchTermResolution(); | 484 animateSearchTermResolution(); |
| 476 } | 485 } |
| 477 | 486 |
| 478 /** | 487 /** |
| 479 * Sets that the contextual search involved the promo. | 488 * Sets that the contextual search involved the promo. |
| 480 */ | 489 */ |
| 481 public void setDidSearchInvolvePromo() { | 490 public void setDidSearchInvolvePromo() { |
| 482 mPanelMetrics.setDidSearchInvolvePromo(); | 491 mPanelMetrics.setDidSearchInvolvePromo(); |
| 483 } | 492 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 734 | 743 |
| 735 /** | 744 /** |
| 736 * Destroy the current content in the panel. | 745 * Destroy the current content in the panel. |
| 737 * NOTE(mdjones): This should not be exposed. The only use is in ContextualS earchManager for a | 746 * NOTE(mdjones): This should not be exposed. The only use is in ContextualS earchManager for a |
| 738 * bug related to loading new panel content. | 747 * bug related to loading new panel content. |
| 739 */ | 748 */ |
| 740 public void destroyContent() { | 749 public void destroyContent() { |
| 741 super.destroyOverlayPanelContent(); | 750 super.destroyOverlayPanelContent(); |
| 742 } | 751 } |
| 743 } | 752 } |
| OLD | NEW |