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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "chrome/browser/ui/search/search_model_observer.h" | 11 #include "chrome/browser/ui/search/search_model_observer.h" |
| 12 #include "chrome/browser/ui/search/toolbar_search_animator.h" |
12 | 13 |
13 class TabContents; | 14 class TabContents; |
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 |
(...skipping 14 matching lines...) Expand all Loading... |
36 void OnTabActivated(TabContents* contents); | 37 void OnTabActivated(TabContents* contents); |
37 | 38 |
38 // When a tab is deactivated, this class no longer observes changes to the | 39 // When a tab is deactivated, this class no longer observes changes to the |
39 // tab's model. | 40 // tab's model. |
40 void OnTabDeactivated(TabContents* contents); | 41 void OnTabDeactivated(TabContents* contents); |
41 | 42 |
42 // When a tab is dettached, this class no longer observes changes to the | 43 // When a tab is dettached, this class no longer observes changes to the |
43 // tab's model. | 44 // tab's model. |
44 void OnTabDetached(TabContents* contents); | 45 void OnTabDetached(TabContents* contents); |
45 | 46 |
| 47 ToolbarSearchAnimator& toolbar_search_animator() { |
| 48 return toolbar_search_animator_; |
| 49 } |
| 50 |
46 private: | 51 private: |
47 // Stop observing tab. | 52 // Stop observing tab. |
48 void StopObserveringTab(TabContents* contents); | 53 void StopObserveringTab(TabContents* contents); |
49 | 54 |
50 // Weak. The Browser class owns this. The active |tab_model_| state is | 55 // Weak. The Browser class owns this. The active |tab_model_| state is |
51 // propagated to the |browser_model_|. | 56 // propagated to the |browser_model_|. |
52 SearchModel* browser_model_; | 57 SearchModel* browser_model_; |
53 | 58 |
54 // Weak. The TabContents owns this. It is the model of the active | 59 // Weak. The TabContents owns this. It is the model of the active |
55 // tab. Changes to this model are propagated through to the |browser_model_|. | 60 // tab. Changes to this model are propagated through to the |browser_model_|. |
56 SearchModel* tab_model_; | 61 SearchModel* tab_model_; |
57 | 62 |
| 63 // Animator for fading in toolbar and tab backgrounds when mode changes from |
| 64 // NTP to SEARCH. |
| 65 ToolbarSearchAnimator toolbar_search_animator_; |
| 66 |
58 DISALLOW_COPY_AND_ASSIGN(SearchDelegate); | 67 DISALLOW_COPY_AND_ASSIGN(SearchDelegate); |
59 }; | 68 }; |
60 | 69 |
61 } // namespace search | 70 } // namespace search |
62 } // namespace chrome | 71 } // namespace chrome |
63 | 72 |
64 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_DELEGATE_H_ | 73 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_DELEGATE_H_ |
OLD | NEW |