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/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 return handled; | 480 return handled; |
481 } | 481 } |
482 | 482 |
483 bool RenderWidgetHostImpl::Send(IPC::Message* msg) { | 483 bool RenderWidgetHostImpl::Send(IPC::Message* msg) { |
484 if (IPC_MESSAGE_ID_CLASS(msg->type()) == InputMsgStart) | 484 if (IPC_MESSAGE_ID_CLASS(msg->type()) == InputMsgStart) |
485 return input_router_->SendInput(make_scoped_ptr(msg)); | 485 return input_router_->SendInput(make_scoped_ptr(msg)); |
486 | 486 |
487 return process_->Send(msg); | 487 return process_->Send(msg); |
488 } | 488 } |
489 | 489 |
| 490 void RenderWidgetHostImpl::SetIsLoading(bool is_loading) { |
| 491 is_loading_ = is_loading; |
| 492 if (!view_) |
| 493 return; |
| 494 view_->SetIsLoading(is_loading); |
| 495 } |
| 496 |
490 void RenderWidgetHostImpl::WasHidden() { | 497 void RenderWidgetHostImpl::WasHidden() { |
491 if (is_hidden_) | 498 if (is_hidden_) |
492 return; | 499 return; |
493 | 500 |
494 is_hidden_ = true; | 501 is_hidden_ = true; |
495 | 502 |
496 // Don't bother reporting hung state when we aren't active. | 503 // Don't bother reporting hung state when we aren't active. |
497 StopHangMonitorTimeout(); | 504 StopHangMonitorTimeout(); |
498 | 505 |
499 // If we have a renderer, then inform it that we are being hidden so it can | 506 // If we have a renderer, then inform it that we are being hidden so it can |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 } | 654 } |
648 | 655 |
649 void RenderWidgetHostImpl::ViewDestroyed() { | 656 void RenderWidgetHostImpl::ViewDestroyed() { |
650 RejectMouseLockOrUnlockIfNecessary(); | 657 RejectMouseLockOrUnlockIfNecessary(); |
651 | 658 |
652 // TODO(evanm): tracking this may no longer be necessary; | 659 // TODO(evanm): tracking this may no longer be necessary; |
653 // eliminate this function if so. | 660 // eliminate this function if so. |
654 SetView(NULL); | 661 SetView(NULL); |
655 } | 662 } |
656 | 663 |
657 void RenderWidgetHostImpl::SetIsLoading(bool is_loading) { | |
658 is_loading_ = is_loading; | |
659 if (!view_) | |
660 return; | |
661 view_->SetIsLoading(is_loading); | |
662 } | |
663 | |
664 void RenderWidgetHostImpl::CopyFromBackingStore( | 664 void RenderWidgetHostImpl::CopyFromBackingStore( |
665 const gfx::Rect& src_subrect, | 665 const gfx::Rect& src_subrect, |
666 const gfx::Size& accelerated_dst_size, | 666 const gfx::Size& accelerated_dst_size, |
667 const base::Callback<void(bool, const SkBitmap&)>& callback, | 667 const base::Callback<void(bool, const SkBitmap&)>& callback, |
668 const SkColorType color_type) { | 668 const SkColorType color_type) { |
669 if (view_) { | 669 if (view_) { |
670 TRACE_EVENT0("browser", | 670 TRACE_EVENT0("browser", |
671 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); | 671 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); |
672 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? | 672 gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ? |
673 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; | 673 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; |
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2317 } | 2317 } |
2318 #endif | 2318 #endif |
2319 | 2319 |
2320 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2320 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2321 if (view_) | 2321 if (view_) |
2322 return view_->PreferredReadbackFormat(); | 2322 return view_->PreferredReadbackFormat(); |
2323 return kN32_SkColorType; | 2323 return kN32_SkColorType; |
2324 } | 2324 } |
2325 | 2325 |
2326 } // namespace content | 2326 } // namespace content |
OLD | NEW |