OLD | NEW |
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_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/ui/search/search_model_observer.h" | 10 #include "chrome/browser/ui/search/search_model_observer.h" |
11 #include "chrome/browser/ui/search/toolbar_search_animator.h" | 11 #include "chrome/browser/ui/search/toolbar_search_animator.h" |
12 | 12 |
13 class TabContents; | 13 class TabContents; |
| 14 class ToolbarModel; |
14 | 15 |
15 namespace chrome { | 16 namespace chrome { |
16 namespace search { | 17 namespace search { |
17 | 18 |
18 class SearchModel; | 19 class SearchModel; |
19 | 20 |
20 // The SearchDelegate class acts as a helper to the Browser class. | 21 // The SearchDelegate class acts as a helper to the Browser class. |
21 // It is responsible for routing the changes from the active tab's | 22 // It is responsible for routing the changes from the active tab's |
22 // SearchModel through to the toolbar, tabstrip and other UI | 23 // SearchModel through to the toolbar, tabstrip and other UI |
23 // observers. | 24 // observers. |
24 // Changes are propagated from the active tab's model via this class to the | 25 // Changes are propagated from the active tab's model via this class to the |
25 // Browser-level model. | 26 // Browser-level model. |
26 class SearchDelegate : public SearchModelObserver { | 27 class SearchDelegate : public SearchModelObserver { |
27 public: | 28 public: |
28 explicit SearchDelegate(SearchModel* model); | 29 SearchDelegate(SearchModel* browser_search_model, |
| 30 ToolbarModel* toolbar_model); |
29 virtual ~SearchDelegate(); | 31 virtual ~SearchDelegate(); |
30 | 32 |
31 // Overrides for SearchModelObserver: | 33 // Overrides for SearchModelObserver: |
32 virtual void ModeChanged(const Mode& old_mode, const Mode& new_mode) OVERRIDE; | 34 virtual void ModeChanged(const Mode& old_mode, const Mode& new_mode) OVERRIDE; |
33 | 35 |
34 // When the active tab is changed, the model state of this new active tab is | 36 // When the active tab is changed, the model state of this new active tab is |
35 // propagated to the browser. | 37 // propagated to the browser. |
36 void OnTabActivated(TabContents* contents); | 38 void OnTabActivated(TabContents* contents); |
37 | 39 |
38 // When a tab is deactivated, this class no longer observes changes to the | 40 // When a tab is deactivated, this class no longer observes changes to the |
(...skipping 24 matching lines...) Expand all Loading... |
63 // NTP to SEARCH. | 65 // NTP to SEARCH. |
64 ToolbarSearchAnimator toolbar_search_animator_; | 66 ToolbarSearchAnimator toolbar_search_animator_; |
65 | 67 |
66 DISALLOW_COPY_AND_ASSIGN(SearchDelegate); | 68 DISALLOW_COPY_AND_ASSIGN(SearchDelegate); |
67 }; | 69 }; |
68 | 70 |
69 } // namespace search | 71 } // namespace search |
70 } // namespace chrome | 72 } // namespace chrome |
71 | 73 |
72 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_DELEGATE_H_ | 74 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_DELEGATE_H_ |
OLD | NEW |