OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/ui/browser_instant_controller.h" | 5 #include "chrome/browser/ui/browser_instant_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 const SearchMode& new_mode = new_state.mode; | 156 const SearchMode& new_mode = new_state.mode; |
157 | 157 |
158 // Record some actions corresponding to the mode change. Note that to get | 158 // Record some actions corresponding to the mode change. Note that to get |
159 // the full story, it's necessary to look at other UMA actions as well, | 159 // the full story, it's necessary to look at other UMA actions as well, |
160 // such as tab switches. | 160 // such as tab switches. |
161 if (new_mode.is_ntp()) | 161 if (new_mode.is_ntp()) |
162 base::RecordAction(base::UserMetricsAction("InstantExtended.ShowNTP")); | 162 base::RecordAction(base::UserMetricsAction("InstantExtended.ShowNTP")); |
163 | 163 |
164 instant_.SearchModeChanged(old_state.mode, new_mode); | 164 instant_.SearchModeChanged(old_state.mode, new_mode); |
165 } | 165 } |
166 | |
167 if (old_state.instant_support != new_state.instant_support) | |
168 instant_.InstantSupportChanged(new_state.instant_support); | |
169 } | 166 } |
170 | 167 |
171 void BrowserInstantController::DefaultSearchProviderChanged( | 168 void BrowserInstantController::DefaultSearchProviderChanged( |
172 bool google_base_url_domain_changed) { | 169 bool google_base_url_domain_changed) { |
173 InstantService* instant_service = | 170 InstantService* instant_service = |
174 InstantServiceFactory::GetForProfile(profile()); | 171 InstantServiceFactory::GetForProfile(profile()); |
175 if (!instant_service) | 172 if (!instant_service) |
176 return; | 173 return; |
177 | 174 |
178 TabStripModel* tab_model = browser_->tab_strip_model(); | 175 TabStripModel* tab_model = browser_->tab_strip_model(); |
(...skipping 19 matching lines...) Expand all Loading... |
198 params.referrer = content::Referrer(); | 195 params.referrer = content::Referrer(); |
199 params.transition_type = ui::PAGE_TRANSITION_RELOAD; | 196 params.transition_type = ui::PAGE_TRANSITION_RELOAD; |
200 contents->GetController().LoadURLWithParams(params); | 197 contents->GetController().LoadURLWithParams(params); |
201 } else { | 198 } else { |
202 // Reload the contents to ensure that it gets assigned to a | 199 // Reload the contents to ensure that it gets assigned to a |
203 // non-privileged renderer. | 200 // non-privileged renderer. |
204 TabReloader::Reload(contents); | 201 TabReloader::Reload(contents); |
205 } | 202 } |
206 } | 203 } |
207 } | 204 } |
OLD | NEW |