| 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/prerender/prerender_contents.h" | 5 #include "chrome/browser/prerender/prerender_contents.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <functional> | 10 #include <functional> |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 422 |
| 423 content::Details<RenderViewHost> new_render_view_host(details); | 423 content::Details<RenderViewHost> new_render_view_host(details); |
| 424 OnRenderViewHostCreated(new_render_view_host.ptr()); | 424 OnRenderViewHostCreated(new_render_view_host.ptr()); |
| 425 | 425 |
| 426 // Make sure the size of the RenderViewHost has been passed to the new | 426 // Make sure the size of the RenderViewHost has been passed to the new |
| 427 // RenderView. Otherwise, the size may not be sent until the | 427 // RenderView. Otherwise, the size may not be sent until the |
| 428 // RenderViewReady event makes it from the render process to the UI | 428 // RenderViewReady event makes it from the render process to the UI |
| 429 // thread of the browser process. When the RenderView receives its | 429 // thread of the browser process. When the RenderView receives its |
| 430 // size, is also sets itself to be visible, which would then break the | 430 // size, is also sets itself to be visible, which would then break the |
| 431 // visibility API. | 431 // visibility API. |
| 432 // TODO(tapted): That comment doesn't sound right. Probably the |
| 433 // CreateWebContents() method should just be passing |initially_hidden| |
| 434 // as true via WebContents::CreateParams. |
| 432 new_render_view_host->GetWidget()->WasResized(); | 435 new_render_view_host->GetWidget()->WasResized(); |
| 433 prerender_contents_->WasHidden(); | 436 prerender_contents_->MarkBackgrounded(); |
| 434 } | 437 } |
| 435 break; | 438 break; |
| 436 } | 439 } |
| 437 | 440 |
| 438 default: | 441 default: |
| 439 NOTREACHED() << "Unexpected notification sent."; | 442 NOTREACHED() << "Unexpected notification sent."; |
| 440 break; | 443 break; |
| 441 } | 444 } |
| 442 } | 445 } |
| 443 | 446 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 void PrerenderContents::AddResourceThrottle( | 763 void PrerenderContents::AddResourceThrottle( |
| 761 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 764 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
| 762 resource_throttles_.push_back(throttle); | 765 resource_throttles_.push_back(throttle); |
| 763 } | 766 } |
| 764 | 767 |
| 765 void PrerenderContents::AddNetworkBytes(int64_t bytes) { | 768 void PrerenderContents::AddNetworkBytes(int64_t bytes) { |
| 766 network_bytes_ += bytes; | 769 network_bytes_ += bytes; |
| 767 } | 770 } |
| 768 | 771 |
| 769 } // namespace prerender | 772 } // namespace prerender |
| OLD | NEW |