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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/search_view_controller.h
diff --git a/chrome/browser/ui/views/search_view_controller.h b/chrome/browser/ui/views/search_view_controller.h
index 17893b3fdcfcd4d069d5f7768f3c8ff6ce4148b7..4fed65c98297f71de361dff548fa341dcde23a14 100644
--- a/chrome/browser/ui/views/search_view_controller.h
+++ b/chrome/browser/ui/views/search_view_controller.h
@@ -8,6 +8,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/ui/search/search_model_observer.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "ui/compositor/layer_animation_observer.h"
class ContentsContainer;
@@ -20,8 +22,13 @@ class SearchModel;
}
}
+namespace content {
+class BrowserContext;
+}
+
namespace views {
class View;
+class WebView;
}
// SearchViewController maintains the search overlay (native new tab page).
@@ -30,9 +37,12 @@ class View;
// class when the active tab changes.
class SearchViewController
: public chrome::search::SearchModelObserver,
- public ui::ImplicitAnimationObserver {
+ public ui::ImplicitAnimationObserver,
+ public content::NotificationObserver {
public:
- explicit SearchViewController(ContentsContainer* contents_container);
+ explicit SearchViewController(chrome::search::SearchModel* search_model,
+ content::BrowserContext* browser_context,
+ ContentsContainer* contents_container);
virtual ~SearchViewController();
views::View* omnibox_popup_view_parent();
@@ -43,7 +53,7 @@ class SearchViewController
}
// Sets the active tab.
- void SetTabContents(TabContents* tab);
+ void SetTabContents(TabContents* tab_contents);
// Stacks the overlay at the top.
void StackAtTop();
@@ -57,6 +67,10 @@ class SearchViewController
// ui::ImplicitAnimationObserver overrides:
virtual void OnImplicitAnimationsCompleted() OVERRIDE;
+ // content::NotificationObserver overrides.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
private:
enum State {
// Search/ntp is not visible.
@@ -95,20 +109,20 @@ class SearchViewController
// Invoked when the visibility of the omnibox popup changes.
void PopupVisibilityChanged();
- // Returns the SearchModel for the current tab, or NULL if there
- // is no current tab.
- chrome::search::SearchModel* search_model();
+ // The browser's search model. Weak.
+ chrome::search::SearchModel* search_model_;
+
+ // The profile. Weak.
+ content::BrowserContext* browser_context_;
- // Where the overlay is placed.
+ // Where the overlay is placed. Weak.
ContentsContainer* contents_container_;
+ // Weak.
LocationBarContainer* location_bar_container_;
State state_;
- // The active TabContents; may be NULL.
- TabContents* tab_;
-
// The following views are created to render the NTP. Visually they look
// something like:
//
@@ -141,9 +155,12 @@ class SearchViewController
views::View* search_container_;
views::View* ntp_view_;
views::View* logo_view_;
- views::View* content_view_;
+ views::WebView* content_view_;
OmniboxPopupViewParent* omnibox_popup_view_parent_;
+ // A scoped notification registrar.
+ content::NotificationRegistrar registrar_;
+
DISALLOW_COPY_AND_ASSIGN(SearchViewController);
};

Powered by Google App Engine
This is Rietveld 408576698