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

Unified Diff: chrome/browser/ui/browser.cc

Issue 222923007: Implement SearchTabHelperDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 6 years, 8 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/search/search_tab_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index b4ef1c2bbf0e87f86d01122d49e8f88b50241170..4288fd4d9567dbb34fe87388ae289442e79d47f0 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -59,6 +59,7 @@
#include "chrome/browser/file_select_helper.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/google/google_url_tracker.h"
+#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/infobars/simple_alert_infobar_delegate.h"
#include "chrome/browser/lifetime/application_lifetime.h"
@@ -131,6 +132,7 @@
#include "chrome/browser/ui/tab_modal_confirm_dialog.h"
#include "chrome/browser/ui/tabs/tab_menu_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/tabs/tab_strip_model_utils.h"
#include "chrome/browser/ui/toolbar/toolbar_model_impl.h"
#include "chrome/browser/ui/unload_controller.h"
#include "chrome/browser/ui/validation_message_bubble.h"
@@ -773,12 +775,6 @@ void Browser::VisibleSSLStateChanged(content::WebContents* web_contents) {
UpdateToolbar(false);
}
-void Browser::OnWebContentsInstantSupportDisabled(
- const content::WebContents* web_contents) {
- DCHECK(web_contents);
- if (tab_strip_model_->GetActiveWebContents() == web_contents)
- UpdateToolbar(false);
-}
///////////////////////////////////////////////////////////////////////////////
// Browser, Assorted browser commands:
@@ -1754,6 +1750,46 @@ void Browser::ConfirmAddSearchProvider(TemplateURL* template_url,
}
///////////////////////////////////////////////////////////////////////////////
+// Browser, SearchTabHelperDelegate implementation:
+
+void Browser::NavigateToURL(const GURL& url,
+ WindowOpenDisposition disposition,
+ content::WebContents* source_contents) {
+ DCHECK(source_contents);
+ chrome::NavigateParams params(this, url,
+ content::PAGE_TRANSITION_AUTO_BOOKMARK);
+ params.referrer = content::Referrer();
+ params.source_contents = source_contents;
+ params.disposition = disposition;
+ params.is_renderer_initiated = false;
+ params.initiating_profile = profile_;
+ chrome::Navigate(&params);
+}
+
+void Browser::OnWebContentsInstantSupportDisabled(
+ const content::WebContents* web_contents) {
+ DCHECK(web_contents);
+ if (tab_strip_model_->GetActiveWebContents() == web_contents)
+ UpdateToolbar(false);
+}
+
+OmniboxView* Browser::GetOmniboxView() {
+ LocationBar* location_bar = window_ ? window_->GetLocationBar() : NULL;
+ return location_bar ? location_bar->GetOmniboxView() : NULL;
+}
+
+void Browser::GetOpenUrls(std::set<std::string>* open_urls) {
+ DCHECK(open_urls);
Jered 2014/04/08 12:32:10 optional: You could also have this method return a
kmadhusu 2014/04/08 18:57:52 Done.
+ history::TopSites* top_sites = profile_->GetTopSites();
+ if (!tab_strip_model_ || !top_sites) {
+ NOTREACHED();
+ return;
+ }
+
+ chrome::GetOpenUrls(*tab_strip_model_, *top_sites, open_urls);
+}
+
+///////////////////////////////////////////////////////////////////////////////
// Browser, web_modal::WebContentsModalDialogManagerDelegate implementation:
void Browser::SetWebContentsBlocked(content::WebContents* web_contents,
@@ -2136,6 +2172,7 @@ void Browser::SetAsDelegate(WebContents* web_contents, Browser* delegate) {
SetDelegate(delegate);
CoreTabHelper::FromWebContents(web_contents)->set_delegate(delegate);
SearchEngineTabHelper::FromWebContents(web_contents)->set_delegate(delegate);
+ SearchTabHelper::FromWebContents(web_contents)->set_delegate(delegate);
ZoomController::FromWebContents(web_contents)->set_observer(delegate);
TranslateTabHelper* translate_tab_helper =
TranslateTabHelper::FromWebContents(web_contents);
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/search/search_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698