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

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: update comments 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
31 newMode:new_mode];
dhollowa 2012/08/01 22:26:23 nit: this should all fit on one line.
kuan 2012/08/02 21:54:03 Done.
30 } 32 }
31 33
32 private: 34 private:
33 // Weak. Owns us. 35 // Weak. Owns us.
34 Receiver* receiver_; 36 Receiver* receiver_;
35 37
36 // Weak. 38 // Weak.
37 SearchModel* model_; 39 SearchModel* model_;
38 40
39 DISALLOW_COPY_AND_ASSIGN(SearchModelObserverBridge); 41 DISALLOW_COPY_AND_ASSIGN(SearchModelObserverBridge);
40 }; 42 };
41 43
42 } // namespace search 44 } // namespace search
43 } // namespace chrome 45 } // namespace chrome
44 46
45 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_OBSERVER_BRIDGE_H_ 47 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_OBSERVER_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698