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 navigation to prefetched Search Results are now v iewable. | |
|
Theresa
2016/02/29 19:42:44
I was confused about what "navigation" meant until
Donn Denman
2016/03/01 21:18:07
OK, I adopted your suggestions for "onPanelNavigat
| |
| 387 * If the user has the panel open then they will see the prefetched result s tarting to load. | |
| 388 * @param didResolve Whether the search required Search Term Resolution. | |
| 389 */ | |
| 390 public void onPrefetchedSearchNavigated(boolean didResolve) { | |
| 391 mPanelMetrics.onPrefetchedSearchNavigated(didResolve); | |
| 392 } | |
| 393 | |
| 394 /** | |
| 386 * Maximizes the Contextual Search Panel, then promotes it to a regular Tab. | 395 * 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. | 396 * @param reason The {@code StateChangeReason} behind the maximization and p romotion to tab. |
| 388 */ | 397 */ |
| 389 public void maximizePanelThenPromoteToTab(StateChangeReason reason) { | 398 public void maximizePanelThenPromoteToTab(StateChangeReason reason) { |
| 390 mShouldPromoteToTabAfterMaximizing = true; | 399 mShouldPromoteToTabAfterMaximizing = true; |
| 391 maximizePanel(reason); | 400 maximizePanel(reason); |
| 392 } | 401 } |
| 393 | 402 |
| 394 /** | 403 /** |
| 395 * Maximizes the Contextual Search Panel, then promotes it to a regular Tab. | 404 * 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) { | 472 public void displaySearchContext(String selection, String end) { |
| 464 cancelSearchTermResolutionAnimation(); | 473 cancelSearchTermResolutionAnimation(); |
| 465 getSearchBarControl().setSearchContext(selection, end); | 474 getSearchBarControl().setSearchContext(selection, end); |
| 466 resetSearchBarContextOpacity(); | 475 resetSearchBarContextOpacity(); |
| 467 } | 476 } |
| 468 | 477 |
| 469 /** | 478 /** |
| 470 * Handles showing the resolved search term in the SearchBar. | 479 * Handles showing the resolved search term in the SearchBar. |
| 471 * @param searchTerm The string that represents the search term. | 480 * @param searchTerm The string that represents the search term. |
| 472 */ | 481 */ |
| 473 public void onSearchTermResolutionResponse(String searchTerm) { | 482 public void onSearchTermResolved(String searchTerm) { |
| 483 mPanelMetrics.onSearchTermResolved(); | |
| 474 getSearchBarControl().setSearchTerm(searchTerm); | 484 getSearchBarControl().setSearchTerm(searchTerm); |
| 475 animateSearchTermResolution(); | 485 animateSearchTermResolution(); |
| 476 } | 486 } |
| 477 | 487 |
| 478 /** | 488 /** |
| 479 * Sets that the contextual search involved the promo. | 489 * Sets that the contextual search involved the promo. |
| 480 */ | 490 */ |
| 481 public void setDidSearchInvolvePromo() { | 491 public void setDidSearchInvolvePromo() { |
| 482 mPanelMetrics.setDidSearchInvolvePromo(); | 492 mPanelMetrics.setDidSearchInvolvePromo(); |
| 483 } | 493 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 734 | 744 |
| 735 /** | 745 /** |
| 736 * Destroy the current content in the panel. | 746 * Destroy the current content in the panel. |
| 737 * NOTE(mdjones): This should not be exposed. The only use is in ContextualS earchManager for a | 747 * NOTE(mdjones): This should not be exposed. The only use is in ContextualS earchManager for a |
| 738 * bug related to loading new panel content. | 748 * bug related to loading new panel content. |
| 739 */ | 749 */ |
| 740 public void destroyContent() { | 750 public void destroyContent() { |
| 741 super.destroyOverlayPanelContent(); | 751 super.destroyOverlayPanelContent(); |
| 742 } | 752 } |
| 743 } | 753 } |
| OLD | NEW |