| 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_VIEWS_SEARCH_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_SEARCH_VIEW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_SEARCH_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_SEARCH_VIEW_CONTROLLER_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 "ui/compositor/layer_animation_observer.h" | 11 #include "ui/compositor/layer_animation_observer.h" |
| 12 | 12 |
| 13 class ContentsContainer; | 13 class ContentsContainer; |
| 14 class LocationBarContainer; | 14 class LocationBarContainer; |
| 15 class TabContents; | 15 class TabContents; |
| 16 | 16 |
| 17 namespace chrome { | 17 namespace chrome { |
| 18 namespace search { | 18 namespace search { |
| 19 class SearchModel; | 19 class SearchModel; |
| 20 } | 20 } |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 class BrowserContext; | 24 class BrowserContext; |
| 25 class WebContents; | 25 class WebContents; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace views { | 28 namespace views { |
| 29 class ImageView; |
| 30 class Label; |
| 29 class View; | 31 class View; |
| 30 class WebView; | 32 class WebView; |
| 31 } | 33 } |
| 32 | 34 |
| 33 // SearchViewController maintains the search overlay (native new tab page). | 35 // SearchViewController maintains the search overlay (native new tab page). |
| 34 // To avoid ordering dependencies this class listens directly to the | 36 // To avoid ordering dependencies this class listens directly to the |
| 35 // SearchModel of the active tab. BrowserView is responsible for telling this | 37 // SearchModel of the active tab. BrowserView is responsible for telling this |
| 36 // class when the active tab changes. | 38 // class when the active tab changes. |
| 37 class SearchViewController | 39 class SearchViewController |
| 38 : public chrome::search::SearchModelObserver, | 40 : public chrome::search::SearchModelObserver, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // from the current state of the SearchModel. | 91 // from the current state of the SearchModel. |
| 90 void SetState(State state); | 92 void SetState(State state); |
| 91 | 93 |
| 92 // Starts the animation. | 94 // Starts the animation. |
| 93 void StartAnimation(); | 95 void StartAnimation(); |
| 94 | 96 |
| 95 // Create the various views and installs them as an overlay on | 97 // Create the various views and installs them as an overlay on |
| 96 // |contents_container_|. | 98 // |contents_container_|. |
| 97 void CreateViews(); | 99 void CreateViews(); |
| 98 | 100 |
| 101 // Return the logo image view, or a label if an image is not available. |
| 102 views::View* GetLogoView() const; |
| 103 |
| 99 // Destroys the various views. | 104 // Destroys the various views. |
| 100 void DestroyViews(); | 105 void DestroyViews(); |
| 101 | 106 |
| 102 // Invoked when the visibility of the omnibox popup changes. | 107 // Invoked when the visibility of the omnibox popup changes. |
| 103 void PopupVisibilityChanged(); | 108 void PopupVisibilityChanged(); |
| 104 | 109 |
| 105 // Access active search model. | 110 // Access active search model. |
| 106 chrome::search::SearchModel* search_model(); | 111 chrome::search::SearchModel* search_model(); |
| 107 | 112 |
| 108 // Access active web contents. | 113 // Access active web contents. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // * - the LocationBarContainer gets positioned here, but it is not a child | 148 // * - the LocationBarContainer gets positioned here, but it is not a child |
| 144 // of any of these views. | 149 // of any of these views. |
| 145 // | 150 // |
| 146 // NTPView and OmniboxPopupViewParent are siblings. When on the NTP the | 151 // NTPView and OmniboxPopupViewParent are siblings. When on the NTP the |
| 147 // OmniboxPopupViewParent is obscured by the NTPView. When on a search page | 152 // OmniboxPopupViewParent is obscured by the NTPView. When on a search page |
| 148 // the NTPView is hidden. | 153 // the NTPView is hidden. |
| 149 // | 154 // |
| 150 // | 155 // |
| 151 views::View* search_container_; | 156 views::View* search_container_; |
| 152 views::View* ntp_view_; | 157 views::View* ntp_view_; |
| 153 views::View* logo_view_; | 158 views::Label* logo_label_; |
| 154 | 159 views::ImageView* logo_image_; |
| 155 // An alias to |contents_container_->active()|, but reparented within | 160 // An alias to |contents_container_->active()|, but reparented within |
| 156 // |ntp_view_| when in the NTP state. | 161 // |ntp_view_| when in the NTP state. |
| 157 views::WebView* content_view_; | 162 views::WebView* content_view_; |
| 158 | 163 |
| 159 OmniboxPopupViewParent* omnibox_popup_view_parent_; | 164 OmniboxPopupViewParent* omnibox_popup_view_parent_; |
| 160 | 165 |
| 161 DISALLOW_COPY_AND_ASSIGN(SearchViewController); | 166 DISALLOW_COPY_AND_ASSIGN(SearchViewController); |
| 162 }; | 167 }; |
| 163 | 168 |
| 164 #endif // CHROME_BROWSER_UI_VIEWS_SEARCH_VIEW_CONTROLLER_H_ | 169 #endif // CHROME_BROWSER_UI_VIEWS_SEARCH_VIEW_CONTROLLER_H_ |
| OLD | NEW |