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

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

Issue 10816027: alternate ntp: toolbar background and separator animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android build break 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
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_OBSERVER_BRIDGE_H_ 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_OBSERVER_BRIDGE_H_
6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_OBSERVER_BRIDGE_H_ 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_OBSERVER_BRIDGE_H_
7 7
8 #include "chrome/browser/ui/search/search_model.h" 8 #include "chrome/browser/ui/search/search_model.h"
9 #include "chrome/browser/ui/search/search_model_observer.h" 9 #include "chrome/browser/ui/search/search_model_observer.h"
10 10
11 namespace chrome { 11 namespace chrome {
12 namespace search { 12 namespace search {
13 13
14 template <class Receiver> 14 template <class Receiver>
15 class SearchModelObserverBridge : public SearchModelObserver { 15 class SearchModelObserverBridge : public SearchModelObserver {
16 public: 16 public:
17 SearchModelObserverBridge(Receiver* receiver, SearchModel* model) 17 SearchModelObserverBridge(Receiver* receiver, SearchModel* model)
18 : receiver_(receiver), 18 : receiver_(receiver),
19 model_(model) { 19 model_(model) {
20 model_->AddObserver(this); 20 model_->AddObserver(this);
21 } 21 }
22 22
23 ~SearchModelObserverBridge() { 23 ~SearchModelObserverBridge() {
24 model_->RemoveObserver(this); 24 model_->RemoveObserver(this);
25 } 25 }
26 26
27 // SearchModelObserver: 27 // SearchModelObserver:
28 virtual void ModeChanged(const Mode& mode) OVERRIDE { 28 virtual void ModeChanged(const Mode& old_mode,
29 [receiver_ modeChanged:mode]; 29 const Mode& new_mode) OVERRIDE {
30 [receiver_ modeChanged:old_mode newMode:new_mode];
30 } 31 }
31 32
32 private: 33 private:
33 // Weak. Owns us. 34 // Weak. Owns us.
34 Receiver* receiver_; 35 Receiver* receiver_;
35 36
36 // Weak. 37 // Weak.
37 SearchModel* model_; 38 SearchModel* model_;
38 39
39 DISALLOW_COPY_AND_ASSIGN(SearchModelObserverBridge); 40 DISALLOW_COPY_AND_ASSIGN(SearchModelObserverBridge);
40 }; 41 };
41 42
42 } // namespace search 43 } // namespace search
43 } // namespace chrome 44 } // namespace chrome
44 45
45 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_OBSERVER_BRIDGE_H_ 46 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_OBSERVER_BRIDGE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_model_observer.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