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

Side by Side Diff: chrome/browser/ui/views/search_view_controller.h

Issue 10787028: Converts SearchViewController to use live NTP content instead of placeholder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Layout hack Created 8 years, 5 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_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 {
24 class BrowserContext;
25 class WebContents;
26 }
27
23 namespace views { 28 namespace views {
24 class View; 29 class View;
30 class WebView;
25 } 31 }
26 32
27 // SearchViewController maintains the search overlay (native new tab page). 33 // SearchViewController maintains the search overlay (native new tab page).
28 // To avoid ordering dependencies this class listens directly to the 34 // To avoid ordering dependencies this class listens directly to the
29 // SearchModel of the active tab. BrowserView is responsible for telling this 35 // SearchModel of the active tab. BrowserView is responsible for telling this
30 // class when the active tab changes. 36 // class when the active tab changes.
31 class SearchViewController 37 class SearchViewController
32 : public chrome::search::SearchModelObserver, 38 : public chrome::search::SearchModelObserver,
33 public ui::ImplicitAnimationObserver { 39 public ui::ImplicitAnimationObserver {
34 public: 40 public:
35 explicit SearchViewController(ContentsContainer* contents_container); 41 SearchViewController(content::BrowserContext* browser_context,
42 ContentsContainer* contents_container);
36 virtual ~SearchViewController(); 43 virtual ~SearchViewController();
37 44
38 views::View* omnibox_popup_view_parent(); 45 views::View* omnibox_popup_view_parent();
39 46
40 void set_location_bar_container( 47 void set_location_bar_container(
41 LocationBarContainer* location_bar_container) { 48 LocationBarContainer* location_bar_container) {
42 location_bar_container_ = location_bar_container; 49 location_bar_container_ = location_bar_container;
43 } 50 }
44 51
45 // Sets the active tab. 52 // Sets the active tab.
46 void SetTabContents(TabContents* tab); 53 void SetTabContents(TabContents* tab_contents);
47 54
48 // Stacks the overlay at the top. 55 // Stacks the overlay at the top.
49 void StackAtTop(); 56 void StackAtTop();
50 57
51 // Invoked when the instant preview is ready to be shown. 58 // Invoked when the instant preview is ready to be shown.
52 void InstantReady(); 59 void InstantReady();
53 60
54 // chrome::search::SearchModelObserver overrides: 61 // chrome::search::SearchModelObserver overrides:
55 virtual void ModeChanged(const chrome::search::Mode& mode) OVERRIDE; 62 virtual void ModeChanged(const chrome::search::Mode& mode) OVERRIDE;
56 63
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // Create the various views and installs them as an overlay on 95 // Create the various views and installs them as an overlay on
89 // |contents_container_|. 96 // |contents_container_|.
90 void CreateViews(); 97 void CreateViews();
91 98
92 // Destroys the various views. 99 // Destroys the various views.
93 void DestroyViews(); 100 void DestroyViews();
94 101
95 // Invoked when the visibility of the omnibox popup changes. 102 // Invoked when the visibility of the omnibox popup changes.
96 void PopupVisibilityChanged(); 103 void PopupVisibilityChanged();
97 104
98 // Returns the SearchModel for the current tab, or NULL if there 105 // Access active search model.
99 // is no current tab.
100 chrome::search::SearchModel* search_model(); 106 chrome::search::SearchModel* search_model();
101 107
102 // Where the overlay is placed. 108 // Access active web contents.
109 content::WebContents* web_contents();
110
111 // The profile. Weak.
112 content::BrowserContext* browser_context_;
113
114 // Where the overlay is placed. Weak.
103 ContentsContainer* contents_container_; 115 ContentsContainer* contents_container_;
104 116
117 // Weak.
105 LocationBarContainer* location_bar_container_; 118 LocationBarContainer* location_bar_container_;
106 119
107 State state_; 120 State state_;
108 121
109 // The active TabContents; may be NULL. 122 // The active TabContents. Weak. May be NULL.
110 TabContents* tab_; 123 TabContents* tab_contents_;
111 124
112 // The following views are created to render the NTP. Visually they look 125 // The following views are created to render the NTP. Visually they look
113 // something like: 126 // something like:
114 // 127 //
115 // |---SearchContainerView------------------------------| 128 // |---SearchContainerView------------------------------|
116 // ||-----NTPView & OmniboxPopupViewParent-------------|| 129 // ||-----NTPView & OmniboxPopupViewParent-------------||
117 // || || 130 // || ||
118 // || |--LogoView----------------------------| || 131 // || |--LogoView----------------------------| ||
119 // || | | || 132 // || | | ||
120 // || | | || 133 // || | | ||
(...skipping 13 matching lines...) Expand all
134 // of any of these views. 147 // of any of these views.
135 // 148 //
136 // NTPView and OmniboxPopupViewParent are siblings. When on the NTP the 149 // NTPView and OmniboxPopupViewParent are siblings. When on the NTP the
137 // OmniboxPopupViewParent is obscured by the NTPView. When on a search page 150 // OmniboxPopupViewParent is obscured by the NTPView. When on a search page
138 // the NTPView is hidden. 151 // the NTPView is hidden.
139 // 152 //
140 // 153 //
141 views::View* search_container_; 154 views::View* search_container_;
142 views::View* ntp_view_; 155 views::View* ntp_view_;
143 views::View* logo_view_; 156 views::View* logo_view_;
144 views::View* content_view_; 157 views::WebView* content_view_;
145 OmniboxPopupViewParent* omnibox_popup_view_parent_; 158 OmniboxPopupViewParent* omnibox_popup_view_parent_;
146 159
147 DISALLOW_COPY_AND_ASSIGN(SearchViewController); 160 DISALLOW_COPY_AND_ASSIGN(SearchViewController);
148 }; 161 };
149 162
150 #endif // CHROME_BROWSER_UI_VIEWS_SEARCH_VIEW_CONTROLLER_H_ 163 #endif // CHROME_BROWSER_UI_VIEWS_SEARCH_VIEW_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/search_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698