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

Unified Diff: chrome/browser/ui/views/search_view_controller.cc

Issue 10837240: Search state transitions not working (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OVERRIDE 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/views/search_view_controller.h ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/search_view_controller.cc
diff --git a/chrome/browser/ui/views/search_view_controller.cc b/chrome/browser/ui/views/search_view_controller.cc
index 118d301d6293eb4df8958fd2a0006a9e5648ba3c..f0f7b207b45ce3848a93495724ecacd228d865c7 100644
--- a/chrome/browser/ui/views/search_view_controller.cc
+++ b/chrome/browser/ui/views/search_view_controller.cc
@@ -299,8 +299,8 @@ void SearchViewController::ModeChanged(const chrome::search::Mode& old_mode,
}
void SearchViewController::OnImplicitAnimationsCompleted() {
- DCHECK_EQ(STATE_ANIMATING, state_);
- state_ = STATE_SEARCH;
+ DCHECK_EQ(STATE_NTP_ANIMATING, state_);
+ state_ = STATE_SUGGESTIONS;
ntp_view_->SetVisible(false);
// While |ntp_view_| was fading out, location bar was animating from the
// middle of the NTP page to the top toolbar, at the same rate.
@@ -326,16 +326,15 @@ void SearchViewController::UpdateState() {
new_state = STATE_NTP;
break;
- case chrome::search::Mode::MODE_SEARCH:
- if (search_model()->mode().animate && state_ == STATE_NTP) {
- new_state = STATE_ANIMATING;
- } else {
- // Only enter into MODE_SEARCH if the omnibox is visible.
- if (omnibox_popup_view_parent_->is_child_visible())
- new_state = STATE_SEARCH;
- else
- new_state = STATE_NOT_VISIBLE;
- }
+ case chrome::search::Mode::MODE_SEARCH_SUGGESTIONS:
+ if (search_model()->mode().animate && state_ == STATE_NTP)
+ new_state = STATE_NTP_ANIMATING;
+ else if (omnibox_popup_view_parent_->is_child_visible())
+ new_state = STATE_SUGGESTIONS;
+ break;
+
+ case chrome::search::Mode::MODE_SEARCH_RESULTS:
+ new_state = STATE_NOT_VISIBLE;
break;
}
SetState(new_state);
@@ -357,13 +356,13 @@ void SearchViewController::SetState(State state) {
CreateViews();
break;
- case STATE_ANIMATING:
+ case STATE_NTP_ANIMATING:
// Should only animate from the ntp.
DCHECK_EQ(STATE_NTP, old_state);
StartAnimation();
break;
- case STATE_SEARCH:
+ case STATE_SUGGESTIONS:
DestroyViews();
CreateViews();
ntp_view_->SetVisible(false);
@@ -477,7 +476,7 @@ void SearchViewController::DestroyViews() {
void SearchViewController::PopupVisibilityChanged() {
// Don't do anything while animating if the child is visible. Otherwise we'll
// prematurely cancel the animation.
- if (state_ != STATE_ANIMATING ||
+ if (state_ != STATE_NTP_ANIMATING ||
!omnibox_popup_view_parent_->is_child_visible()) {
UpdateState();
}
« no previous file with comments | « chrome/browser/ui/views/search_view_controller.h ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698