OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/instant/instant_loader.h" | 5 #include "chrome/browser/instant/instant_loader.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 virtual void WillShowConstrainedWindow(TabContentsWrapper* source) OVERRIDE; | 254 virtual void WillShowConstrainedWindow(TabContentsWrapper* source) OVERRIDE; |
255 virtual bool ShouldFocusConstrainedWindow() OVERRIDE; | 255 virtual bool ShouldFocusConstrainedWindow() OVERRIDE; |
256 | 256 |
257 // content::WebContentsObserver: | 257 // content::WebContentsObserver: |
258 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 258 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
259 virtual void DidFailProvisionalLoad( | 259 virtual void DidFailProvisionalLoad( |
260 int64 frame_id, | 260 int64 frame_id, |
261 bool is_main_frame, | 261 bool is_main_frame, |
262 const GURL& validated_url, | 262 const GURL& validated_url, |
263 int error_code, | 263 int error_code, |
264 const string16& error_description) OVERRIDE; | 264 const string16& error_description, |
| 265 content::RenderViewHost* render_view_host) OVERRIDE; |
265 | 266 |
266 private: | 267 private: |
267 typedef std::vector<scoped_refptr<history::HistoryAddPageArgs> > | 268 typedef std::vector<scoped_refptr<history::HistoryAddPageArgs> > |
268 AddPageVector; | 269 AddPageVector; |
269 | 270 |
270 // Message from renderer indicating the page has suggestions. | 271 // Message from renderer indicating the page has suggestions. |
271 void OnSetSuggestions( | 272 void OnSetSuggestions( |
272 int32 page_id, | 273 int32 page_id, |
273 const std::vector<std::string>& suggestions, | 274 const std::vector<std::string>& suggestions, |
274 InstantCompleteBehavior behavior); | 275 InstantCompleteBehavior behavior); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 IPC_MESSAGE_UNHANDLED(handled = false) | 565 IPC_MESSAGE_UNHANDLED(handled = false) |
565 IPC_END_MESSAGE_MAP() | 566 IPC_END_MESSAGE_MAP() |
566 return handled; | 567 return handled; |
567 } | 568 } |
568 | 569 |
569 void InstantLoader::TabContentsDelegateImpl::DidFailProvisionalLoad( | 570 void InstantLoader::TabContentsDelegateImpl::DidFailProvisionalLoad( |
570 int64 frame_id, | 571 int64 frame_id, |
571 bool is_main_frame, | 572 bool is_main_frame, |
572 const GURL& validated_url, | 573 const GURL& validated_url, |
573 int error_code, | 574 int error_code, |
574 const string16& error_description) { | 575 const string16& error_description, |
| 576 content::RenderViewHost* render_view_host) { |
575 if (validated_url == loader_->url_) { | 577 if (validated_url == loader_->url_) { |
576 // This typically happens with downloads (which are disabled with | 578 // This typically happens with downloads (which are disabled with |
577 // instant active). To ensure the download happens when the user presses | 579 // instant active). To ensure the download happens when the user presses |
578 // enter we set needs_reload_ to true, which triggers a reload. | 580 // enter we set needs_reload_ to true, which triggers a reload. |
579 loader_->needs_reload_ = true; | 581 loader_->needs_reload_ = true; |
580 } | 582 } |
581 } | 583 } |
582 | 584 |
583 void InstantLoader::TabContentsDelegateImpl::OnSetSuggestions( | 585 void InstantLoader::TabContentsDelegateImpl::OnSetSuggestions( |
584 int32 page_id, | 586 int32 page_id, |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 host->Send(new ChromeViewMsg_SearchBoxResize( | 1155 host->Send(new ChromeViewMsg_SearchBoxResize( |
1154 host->GetRoutingID(), GetOmniboxBoundsInTermsOfPreview())); | 1156 host->GetRoutingID(), GetOmniboxBoundsInTermsOfPreview())); |
1155 } else { | 1157 } else { |
1156 host->Send(new ChromeViewMsg_SearchBoxChange( | 1158 host->Send(new ChromeViewMsg_SearchBoxChange( |
1157 host->GetRoutingID(), user_text, verbatim, 0, 0)); | 1159 host->GetRoutingID(), user_text, verbatim, 0, 0)); |
1158 } | 1160 } |
1159 | 1161 |
1160 frame_load_observer_.reset(new FrameLoadObserver( | 1162 frame_load_observer_.reset(new FrameLoadObserver( |
1161 this, preview_contents()->web_contents(), user_text, verbatim)); | 1163 this, preview_contents()->web_contents(), user_text, verbatim)); |
1162 } | 1164 } |
OLD | NEW |