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

Side by Side Diff: chrome/browser/ui/search/search_model.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/search/search_model.h ('k') | chrome/browser/ui/search/search_tab_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/search_model.h" 5 #include "chrome/browser/ui/search/search_model.h"
6 6
7 #include "chrome/browser/ui/search/search.h" 7 #include "chrome/browser/ui/search/search.h"
8 #include "chrome/browser/ui/search/search_model_observer.h" 8 #include "chrome/browser/ui/search/search_model_observer.h"
9 #include "chrome/browser/ui/tab_contents/tab_contents.h" 9 #include "chrome/browser/ui/tab_contents/tab_contents.h"
10 10
(...skipping 21 matching lines...) Expand all
32 const Mode old_mode = mode_; 32 const Mode old_mode = mode_;
33 mode_ = new_mode; 33 mode_ = new_mode;
34 34
35 FOR_EACH_OBSERVER(SearchModelObserver, observers_, 35 FOR_EACH_OBSERVER(SearchModelObserver, observers_,
36 ModeChanged(old_mode, mode_)); 36 ModeChanged(old_mode, mode_));
37 37
38 // Animation is transient, it is cleared after observers are notified. 38 // Animation is transient, it is cleared after observers are notified.
39 mode_.animate = false; 39 mode_.animate = false;
40 } 40 }
41 41
42 void SearchModel::MaybeChangeMode(Mode::Type from_mode, Mode::Type to_mode) {
43 if (mode_.mode == from_mode) {
44 Mode mode(to_mode, true);
45 SetMode(mode);
46 }
47 }
48
49 void SearchModel::AddObserver(SearchModelObserver* observer) { 42 void SearchModel::AddObserver(SearchModelObserver* observer) {
50 observers_.AddObserver(observer); 43 observers_.AddObserver(observer);
51 } 44 }
52 45
53 void SearchModel::RemoveObserver(SearchModelObserver* observer) { 46 void SearchModel::RemoveObserver(SearchModelObserver* observer) {
54 observers_.RemoveObserver(observer); 47 observers_.RemoveObserver(observer);
55 } 48 }
56 49
57 } // namespace search 50 } // namespace search
58 } // namespace chrome 51 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_model.h ('k') | chrome/browser/ui/search/search_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698