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

Unified Diff: chrome/browser/ui/search/toolbar_search_animator.cc

Issue 10873094: alternate ntp: fix toolbar separator visibility when query is cleared (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « chrome/browser/ui/search/toolbar_search_animator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/toolbar_search_animator.cc
diff --git a/chrome/browser/ui/search/toolbar_search_animator.cc b/chrome/browser/ui/search/toolbar_search_animator.cc
index 7631a262deafc07a3ce74f4f0a154cf3b8e14dcd..9043a14cdc674b3e50088d96f66166cbbccc9682 100644
--- a/chrome/browser/ui/search/toolbar_search_animator.cc
+++ b/chrome/browser/ui/search/toolbar_search_animator.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/ui/search/search_types.h"
#include "chrome/browser/ui/search/toolbar_search_animator_observer.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
+#include "chrome/browser/ui/toolbar/toolbar_model.h"
#include "chrome/browser/ui/webui/instant_ui.h"
#include "ui/base/animation/multi_animation.h"
@@ -24,8 +25,10 @@ const double kMaxOpacity = 1.0f;
namespace chrome {
namespace search {
-ToolbarSearchAnimator::ToolbarSearchAnimator(SearchModel* search_model)
+ToolbarSearchAnimator::ToolbarSearchAnimator(SearchModel* search_model,
+ ToolbarModel* toolbar_model)
: search_model_(search_model),
+ toolbar_model_(toolbar_model),
background_change_delay_ms_(kBackgroundChangeDelayMs),
background_change_duration_ms_(kBackgroundChangeDurationMs),
is_omnibox_popup_open_(false) {
@@ -46,12 +49,13 @@ double ToolbarSearchAnimator::GetGradientOpacity() const {
bool ToolbarSearchAnimator::IsToolbarSeparatorVisible() const {
// The toolbar separator is only visible in 2 scenarios:
- // 1) when mode is |SEARCH_SUGGESTIONS| and the omnibox popup has finished
- // retracting before the navigation URL was committed, i.e. before the
- // mode was changed to |DEFAULT|.
+ // 1) when mode is |SEARCH_SUGGESTIONS|, user input is not in progress, and
+ // the omnibox popup has finished retracting before the navigation URL was
+ // committed, i.e. before the mode was changed to |DEFAULT|.
// 2) when mode is |DEFAULT| and the omnibox popup has finished retracting.
return !is_omnibox_popup_open_ &&
- (search_model_->mode().mode == Mode::MODE_SEARCH_SUGGESTIONS ||
+ ((search_model_->mode().mode == Mode::MODE_SEARCH_SUGGESTIONS &&
+ !toolbar_model_->input_in_progress()) ||
search_model_->mode().is_default());
}
« no previous file with comments | « chrome/browser/ui/search/toolbar_search_animator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698