diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 21:08:59 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 21:08:59 +0000 |
commit | 34aea8d629c102381ccb5c8a56e3f89df969b183 (patch) | |
tree | 426af9fb7d1a701e401b58b919489ed474393a14 /chrome/browser/ui/browser_instant_controller.cc | |
parent | 9031ef57ba679037fc675bf2f081f3880380de3a (diff) | |
download | chromium_src-34aea8d629c102381ccb5c8a56e3f89df969b183.zip chromium_src-34aea8d629c102381ccb5c8a56e3f89df969b183.tar.gz chromium_src-34aea8d629c102381ccb5c8a56e3f89df969b183.tar.bz2 |
Revert of Handle TemplateURLService load failure better, and make some test correctness fixes that will be ne… (https://codereview.chromium.org/272573004/)
Reason for revert:
Seems to be causing use after free on Mac: http://build.chromium.org/p/chromium.memory/builders/Mac%20ASan%2064%20Tests%20%281%29/builds/759
Original issue's description:
> Handle TemplateURLService load failure better, and make some test correctness fixes that will be needed later.
>
> This also does a variety of miscellaneous cleanups to the modified files.
>
> BUG=364183
> TEST=none
> R=jered@chromium.org, pkasting@chromium.org
> TBR=engedy
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269329
TBR=pkasting@chromium.org,zea@chromium.org,jered@chromium.org,engedy@chromium.org,erikwright@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=364183
Review URL: https://codereview.chromium.org/273153004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269637 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_instant_controller.cc')
-rw-r--r-- | chrome/browser/ui/browser_instant_controller.cc | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc index 3e95e32..d1d8e92 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 @@ InstantSearchPrerenderer* GetInstantSearchPrerenderer(Profile* profile) { } // namespace - -// BrowserInstantController --------------------------------------------------- +//////////////////////////////////////////////////////////////////////////////// +// BrowserInstantController, public: BrowserInstantController::BrowserInstantController(Browser* browser) : browser_(browser), @@ -120,6 +119,9 @@ void BrowserInstantController::TabDeactivated(content::WebContents* contents) { prerenderer->Cancel(); } +//////////////////////////////////////////////////////////////////////////////// +// BrowserInstantController, SearchModelObserver implementation: + void BrowserInstantController::ModelChanged( const SearchModel::State& old_state, const SearchModel::State& new_state) { @@ -130,9 +132,9 @@ void BrowserInstantController::ModelChanged( // 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 @@ void BrowserInstantController::ModelChanged( 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) |