| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 if (!loader_->ready() && !registered_render_widget_host_ && | 427 if (!loader_->ready() && !registered_render_widget_host_ && |
| 428 source->GetController().entry_count()) { | 428 source->GetController().entry_count()) { |
| 429 // The load has been committed. Install an observer that waits for the | 429 // The load has been committed. Install an observer that waits for the |
| 430 // first paint then makes the preview active. We wait for the load to be | 430 // first paint then makes the preview active. We wait for the load to be |
| 431 // committed before waiting on paint as there is always an initial paint | 431 // committed before waiting on paint as there is always an initial paint |
| 432 // when a new renderer is created from the resize so that if we showed the | 432 // when a new renderer is created from the resize so that if we showed the |
| 433 // preview after the first paint we would end up with a white rect. | 433 // preview after the first paint we would end up with a white rect. |
| 434 RenderWidgetHostView *rwhv = source->GetRenderWidgetHostView(); | 434 RenderWidgetHostView *rwhv = source->GetRenderWidgetHostView(); |
| 435 if (rwhv) | 435 if (rwhv) |
| 436 RegisterForPaintNotifications(rwhv->GetRenderWidgetHost()); | 436 RegisterForPaintNotifications(rwhv->GetRenderWidgetHost()); |
| 437 } else if (source->is_crashed()) { | 437 } else if (source->IsCrashed()) { |
| 438 PreviewPainted(); | 438 PreviewPainted(); |
| 439 } | 439 } |
| 440 } | 440 } |
| 441 | 441 |
| 442 void InstantLoader::TabContentsDelegateImpl::AddNavigationHeaders( | 442 void InstantLoader::TabContentsDelegateImpl::AddNavigationHeaders( |
| 443 const GURL& url, | 443 const GURL& url, |
| 444 std::string* headers) { | 444 std::string* headers) { |
| 445 net::HttpUtil::AppendHeaderIfMissing(kInstantHeader, kInstantHeaderValue, | 445 net::HttpUtil::AppendHeaderIfMissing(kInstantHeader, kInstantHeaderValue, |
| 446 headers); | 446 headers); |
| 447 } | 447 } |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 host->Send(new ChromeViewMsg_SearchBoxResize( | 1102 host->Send(new ChromeViewMsg_SearchBoxResize( |
| 1103 host->routing_id(), GetOmniboxBoundsInTermsOfPreview())); | 1103 host->routing_id(), GetOmniboxBoundsInTermsOfPreview())); |
| 1104 } else { | 1104 } else { |
| 1105 host->Send(new ChromeViewMsg_SearchBoxChange( | 1105 host->Send(new ChromeViewMsg_SearchBoxChange( |
| 1106 host->routing_id(), user_text, verbatim, 0, 0)); | 1106 host->routing_id(), user_text, verbatim, 0, 0)); |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 frame_load_observer_.reset(new FrameLoadObserver( | 1109 frame_load_observer_.reset(new FrameLoadObserver( |
| 1110 this, preview_contents()->tab_contents(), user_text, verbatim)); | 1110 this, preview_contents()->tab_contents(), user_text, verbatim)); |
| 1111 } | 1111 } |
| OLD | NEW |