Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(939)

Unified Diff: chrome/browser/ui/omnibox/omnibox_view.cc

Issue 200783003: [OriginChip] Add animations for the hiding and showing of the chip. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to comment Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/omnibox/omnibox_view.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_view.cc b/chrome/browser/ui/omnibox/omnibox_view.cc
index d5c6847dd5b37d38d12cbf46123cdebb7c2f7db1..8779f00b0493cbfd19fe4292cdd081ccbda75cc6 100644
--- a/chrome/browser/ui/omnibox/omnibox_view.cc
+++ b/chrome/browser/ui/omnibox/omnibox_view.cc
@@ -93,23 +93,14 @@ void OmniboxView::HandleOriginChipMouseRelease() {
if ((chrome::GetOriginChipV2HideTrigger() ==
chrome::ORIGIN_CHIP_V2_HIDE_ON_MOUSE_RELEASE) &&
controller()->GetToolbarModel()->GetText().empty()) {
- controller()->GetToolbarModel()->set_origin_chip_enabled(false);
- controller()->OnChanged();
+ controller()->HideOriginChip();
}
}
void OmniboxView::OnDidKillFocus() {
- // If user input is not in progress, re-enable the origin chip and URL
- // replacement. This addresses the case where the URL was shown by a call
- // to ShowURL(). If the Omnibox achieved focus by other means, the calls to
- // set_url_replacement_enabled, UpdatePermanentText and RevertAll are not
- // required (a call to OnChanged would be sufficient) but do no harm.
if (chrome::ShouldDisplayOriginChipV2() &&
!model()->user_input_in_progress()) {
- controller()->GetToolbarModel()->set_origin_chip_enabled(true);
- controller()->GetToolbarModel()->set_url_replacement_enabled(true);
- model()->UpdatePermanentText();
- RevertAll();
+ controller()->ShowOriginChip();
}
}
@@ -178,6 +169,13 @@ void OmniboxView::ShowURL() {
SelectAll(true);
}
+void OmniboxView::HideURL() {
+ controller_->GetToolbarModel()->set_origin_chip_enabled(true);
+ controller_->GetToolbarModel()->set_url_replacement_enabled(true);
+ model_->UpdatePermanentText();
+ RevertWithoutResettingSearchTermReplacement();
+}
+
void OmniboxView::RevertAll() {
controller_->GetToolbarModel()->set_url_replacement_enabled(true);
RevertWithoutResettingSearchTermReplacement();

Powered by Google App Engine
This is Rietveld 408576698