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

Side by Side Diff: chrome/browser/ui/search/search_model.h

Issue 12631008: alternate ntp: implement Show/HideBars API to reduce jank when showing/hiding bars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased, resolved conflicts Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_
6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_ 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/observer_list.h" 9 #include "base/observer_list.h"
10 #include "chrome/common/search_types.h" 10 #include "chrome/common/search_types.h"
11 11
12 namespace chrome { 12 namespace chrome {
13 namespace search { 13 namespace search {
14 14
15 class SearchModelObserver; 15 class SearchModelObserver;
16 16
17 // An observable model for UI components that care about search model state 17 // An observable model for UI components that care about search model state
18 // changes. 18 // changes.
19 class SearchModel { 19 class SearchModel {
20 public: 20 public:
21 SearchModel(); 21 SearchModel();
22 ~SearchModel(); 22 ~SearchModel();
23 23
24 // Change the mode. Change notifications are sent to observers. An animated 24 // Change the mode. Change notifications are sent to observers.
25 // transition may be requested.
26 void SetMode(const Mode& mode); 25 void SetMode(const Mode& mode);
27 26
28 // Get the active mode. 27 // Get the active mode.
29 const Mode& mode() const { return mode_; } 28 const Mode& mode() const { return mode_; }
30 29
30 // Set visibility of top bars (bookmark and info bars). Notifications are
31 // sent to observers.
32 void SetTopBarsVisible(bool visible);
33
34 // Get the visibility of top bars (bookmark and info bars).
35 bool top_bars_visible() const { return top_bars_visible_; }
36
31 // Add and remove observers. 37 // Add and remove observers.
32 void AddObserver(SearchModelObserver* observer); 38 void AddObserver(SearchModelObserver* observer);
33 void RemoveObserver(SearchModelObserver* observer); 39 void RemoveObserver(SearchModelObserver* observer);
34 40
35 private: 41 private:
36 // The display mode of UI elements such as the toolbar, the tab strip, etc. 42 // The display mode of UI elements such as the toolbar, the tab strip, etc.
dhollowa 2013/03/13 17:21:55 For cleanliness, let's stick this model data into
kuan 2013/03/13 22:21:07 Done.
37 Mode mode_; 43 Mode mode_;
38 44
45 // The visibility of top bars (bookmark and info bars).
46 bool top_bars_visible_;
47
39 // Observers. 48 // Observers.
40 ObserverList<SearchModelObserver> observers_; 49 ObserverList<SearchModelObserver> observers_;
41 50
42 DISALLOW_COPY_AND_ASSIGN(SearchModel); 51 DISALLOW_COPY_AND_ASSIGN(SearchModel);
43 }; 52 };
44 53
45 } // namespace search 54 } // namespace search
46 } // namespace chrome 55 } // namespace chrome
47 56
48 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_ 57 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698