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

Side by Side Diff: chrome/browser/ui/search/toolbar_search_animator.cc

Issue 11040055: Adds a FakeToolbarModel for use in testing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: git try Created 8 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/search/toolbar_search_animator.h" 5 #include "chrome/browser/ui/search/toolbar_search_animator.h"
6 6
7 #include "chrome/browser/ui/search/search_model.h" 7 #include "chrome/browser/ui/search/search_model.h"
8 #include "chrome/browser/ui/search/search_types.h" 8 #include "chrome/browser/ui/search/search_types.h"
9 #include "chrome/browser/ui/search/toolbar_search_animator_observer.h" 9 #include "chrome/browser/ui/search/toolbar_search_animator_observer.h"
10 #include "chrome/browser/ui/toolbar/toolbar_model.h" 10 #include "chrome/browser/ui/toolbar/toolbar_model.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 bool ToolbarSearchAnimator::IsToolbarSeparatorVisible() const { 49 bool ToolbarSearchAnimator::IsToolbarSeparatorVisible() const {
50 // The toolbar separator is only visible in 2 scenarios: 50 // The toolbar separator is only visible in 2 scenarios:
51 // 1) when mode is |SEARCH_SUGGESTIONS|, user input is not in progress, and 51 // 1) when mode is |SEARCH_SUGGESTIONS|, user input is not in progress, and
52 // the omnibox popup has finished retracting before the navigation URL was 52 // the omnibox popup has finished retracting before the navigation URL was
53 // committed, i.e. before the mode was changed to |DEFAULT|. 53 // committed, i.e. before the mode was changed to |DEFAULT|.
54 // 2) when mode is |DEFAULT| and the omnibox popup has finished retracting. 54 // 2) when mode is |DEFAULT| and the omnibox popup has finished retracting.
55 return !is_omnibox_popup_open_ && 55 return !is_omnibox_popup_open_ &&
56 ((search_model_->mode().mode == Mode::MODE_SEARCH_SUGGESTIONS && 56 ((search_model_->mode().mode == Mode::MODE_SEARCH_SUGGESTIONS &&
57 !toolbar_model_->input_in_progress()) || 57 !toolbar_model_->GetInputInProgress()) ||
58 search_model_->mode().is_default()); 58 search_model_->mode().is_default());
59 } 59 }
60 60
61 void ToolbarSearchAnimator::OnOmniboxPopupClosed() { 61 void ToolbarSearchAnimator::OnOmniboxPopupClosed() {
62 is_omnibox_popup_open_ = false; 62 is_omnibox_popup_open_ = false;
63 FOR_EACH_OBSERVER(ToolbarSearchAnimatorObserver, observers_, 63 FOR_EACH_OBSERVER(ToolbarSearchAnimatorObserver, observers_,
64 OnToolbarSeparatorChanged()); 64 OnToolbarSeparatorChanged());
65 } 65 }
66 66
67 void ToolbarSearchAnimator::FinishAnimation( 67 void ToolbarSearchAnimator::FinishAnimation(
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 // Notify observers of animation cancelation. 155 // Notify observers of animation cancelation.
156 if (notify_background_observers) { 156 if (notify_background_observers) {
157 FOR_EACH_OBSERVER(ToolbarSearchAnimatorObserver, observers_, 157 FOR_EACH_OBSERVER(ToolbarSearchAnimatorObserver, observers_,
158 OnToolbarBackgroundAnimatorCanceled(web_contents)); 158 OnToolbarBackgroundAnimatorCanceled(web_contents));
159 } 159 }
160 } 160 }
161 161
162 } // namespace search 162 } // namespace search
163 } // namespace chrome 163 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.cc ('k') | chrome/browser/ui/toolbar/test_toolbar_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698