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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 3357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3368 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { | 3368 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { |
3369 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost()) | 3369 if (delegate_ && rfh->GetRenderViewHost() == GetRenderViewHost()) |
3370 delegate_->SwappedOut(this); | 3370 delegate_->SwappedOut(this); |
3371 } | 3371 } |
3372 | 3372 |
3373 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { | 3373 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { |
3374 if (delegate_ && delegate_->IsPopupOrPanel(this)) | 3374 if (delegate_ && delegate_->IsPopupOrPanel(this)) |
3375 delegate_->MoveContents(this, new_bounds); | 3375 delegate_->MoveContents(this, new_bounds); |
3376 } | 3376 } |
3377 | 3377 |
3378 void WebContentsImpl::DidStartLoading(RenderFrameHost* render_frame_host, | 3378 void WebContentsImpl::DidStartLoading(RenderFrameHostImpl* render_frame_host, |
3379 bool to_different_document) { | 3379 bool to_different_document) { |
3380 SetIsLoading(render_frame_host->GetRenderViewHost(), true, | 3380 SetIsLoading(render_frame_host->GetRenderViewHost(), true, |
3381 to_different_document, NULL); | 3381 to_different_document, NULL); |
3382 } | 3382 } |
3383 | 3383 |
3384 void WebContentsImpl::DidStopLoading(RenderFrameHost* render_frame_host) { | 3384 void WebContentsImpl::DidStopLoading(RenderFrameHostImpl* render_frame_host) { |
3385 scoped_ptr<LoadNotificationDetails> details; | 3385 scoped_ptr<LoadNotificationDetails> details; |
3386 | 3386 |
3387 // Use the last committed entry rather than the active one, in case a | 3387 // Use the last committed entry rather than the active one, in case a |
3388 // pending entry has been created. | 3388 // pending entry has been created. |
3389 NavigationEntry* entry = controller_.GetLastCommittedEntry(); | 3389 NavigationEntry* entry = controller_.GetLastCommittedEntry(); |
3390 Navigator* navigator = frame_tree_.root()->navigator(); | 3390 Navigator* navigator = frame_tree_.root()->navigator(); |
3391 | 3391 |
3392 // An entry may not exist for a stop when loading an initial blank page or | 3392 // An entry may not exist for a stop when loading an initial blank page or |
3393 // if an iframe injected by script into a blank page finishes loading. | 3393 // if an iframe injected by script into a blank page finishes loading. |
3394 if (entry) { | 3394 if (entry) { |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3924 | 3924 |
3925 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3925 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
3926 if (!delegate_) | 3926 if (!delegate_) |
3927 return; | 3927 return; |
3928 const gfx::Size new_size = GetPreferredSize(); | 3928 const gfx::Size new_size = GetPreferredSize(); |
3929 if (new_size != old_size) | 3929 if (new_size != old_size) |
3930 delegate_->UpdatePreferredSize(this, new_size); | 3930 delegate_->UpdatePreferredSize(this, new_size); |
3931 } | 3931 } |
3932 | 3932 |
3933 } // namespace content | 3933 } // namespace content |
OLD | NEW |