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

Unified Diff: chrome/browser/instant/instant_loader.cc

Issue 11833043: Instant Extended: Fallback to local preview if the remote instant page is not ready on user input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor
Patch Set: Fixing tests. Created 7 years, 11 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/instant/instant_loader.cc
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index b28fdc654de9ea38a96070194de439a5c1b83de5..2e088d0e630fc89c65c2037938f6fad7435aae9a 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -184,7 +184,8 @@ InstantLoader::InstantLoader(InstantController* controller,
ALLOW_THIS_IN_INITIALIZER_LIST(this))),
instant_url_(instant_url),
supports_instant_(false),
- is_pointer_down_from_activate_(false) {
+ is_pointer_down_from_activate_(false),
+ is_in_fallback_mode_(false) {
}
InstantLoader::~InstantLoader() {
@@ -215,6 +216,10 @@ content::WebContents* InstantLoader::ReleaseContents() {
return contents_.release();
}
+void InstantLoader::set_is_in_fallback_mode() {
+ is_in_fallback_mode_ = true;
+}
+
void InstantLoader::DidNavigate(
const history::HistoryAddPageArgs& add_page_args) {
last_navigation_ = add_page_args;
@@ -248,6 +253,10 @@ void InstantLoader::SetMarginSize(int start, int end) {
client_.SetMarginSize(start, end);
}
+void InstantLoader::InitializeFonts() {
+ client_.InitializeFonts();
+}
+
void InstantLoader::SendAutocompleteResults(
const std::vector<InstantAutocompleteResult>& results) {
client_.SendAutocompleteResults(results);
@@ -324,6 +333,19 @@ void InstantLoader::NavigateToURL(const GURL& url,
controller_->NavigateToURL(url, transition);
}
+void InstantLoader::RenderViewCreated(content::RenderViewHost* host) {
+ if (!controller_->extended_enabled())
+ return;
+
+ // Ensure the searchbox API has the correct initial state.
+ SetDisplayInstantResults(controller_->instant_enabled());
+ SearchModeChanged(controller_->search_mode());
+ KeyCaptureChanged(controller_->omnibox_focus_state() ==
+ OMNIBOX_FOCUS_INVISIBLE);
+ SetMarginSize(controller_->start_margin(), controller_->end_margin());
+ InitializeFonts();
+}
+
void InstantLoader::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {

Powered by Google App Engine
This is Rietveld 408576698