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

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

Issue 273153004: Revert of Handle TemplateURLService load failure better, and make some test correctness fixes that will be ne… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/browser_instant_controller.cc
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index 3e95e325a1a2cafeddc3491ca24746dc1a52075e..d1d8e92bacc7cbaceafe2dd5b7ac894afa35f811 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -26,8 +26,7 @@
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
-
-// Helpers --------------------------------------------------------------------
+using base::UserMetricsAction;
namespace {
@@ -40,8 +39,8 @@
} // namespace
-
-// BrowserInstantController ---------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////
+// BrowserInstantController, public:
BrowserInstantController::BrowserInstantController(Browser* browser)
: browser_(browser),
@@ -120,6 +119,9 @@
prerenderer->Cancel();
}
+////////////////////////////////////////////////////////////////////////////////
+// BrowserInstantController, SearchModelObserver implementation:
+
void BrowserInstantController::ModelChanged(
const SearchModel::State& old_state,
const SearchModel::State& new_state) {
@@ -130,9 +132,9 @@
// the full story, it's necessary to look at other UMA actions as well,
// such as tab switches.
if (new_mode.is_search_results())
- content::RecordAction(base::UserMetricsAction("InstantExtended.ShowSRP"));
+ content::RecordAction(UserMetricsAction("InstantExtended.ShowSRP"));
else if (new_mode.is_ntp())
- content::RecordAction(base::UserMetricsAction("InstantExtended.ShowNTP"));
+ content::RecordAction(UserMetricsAction("InstantExtended.ShowNTP"));
instant_.SearchModeChanged(old_state.mode, new_mode);
}
@@ -141,7 +143,18 @@
instant_.InstantSupportChanged(new_state.instant_support);
}
+////////////////////////////////////////////////////////////////////////////////
+// BrowserInstantController, InstantServiceObserver implementation:
+
void BrowserInstantController::DefaultSearchProviderChanged() {
+ ReloadTabsInInstantProcess();
+}
+
+void BrowserInstantController::GoogleURLUpdated() {
+ ReloadTabsInInstantProcess();
+}
+
+void BrowserInstantController::ReloadTabsInInstantProcess() {
InstantService* instant_service =
InstantServiceFactory::GetForProfile(profile());
if (!instant_service)
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.h ('k') | chrome/browser/ui/browser_instant_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698