| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/renderer_host/render_widget_host.h" | 5 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 6 | 6 |
| 7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
| 10 #include "chrome/browser/renderer_host/backing_store.h" | 10 #include "chrome/browser/renderer_host/backing_store.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 RenderWidgetHost::~RenderWidgetHost() { | 89 RenderWidgetHost::~RenderWidgetHost() { |
| 90 // Clear our current or cached backing store if either remains. | 90 // Clear our current or cached backing store if either remains. |
| 91 BackingStoreManager::RemoveBackingStore(this); | 91 BackingStoreManager::RemoveBackingStore(this); |
| 92 | 92 |
| 93 process_->Release(routing_id_); | 93 process_->Release(routing_id_); |
| 94 } | 94 } |
| 95 | 95 |
| 96 gfx::NativeViewId RenderWidgetHost::GetNativeViewId() { | 96 gfx::NativeViewId RenderWidgetHost::GetNativeViewId() { |
| 97 if (view_) | 97 if (view_) |
| 98 return gfx::IdFromNativeView(view_->GetNativeView()); | 98 return gfx::IdFromNativeView(view_->GetNativeView()); |
| 99 return 0; | 99 return NULL; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void RenderWidgetHost::Init() { | 102 void RenderWidgetHost::Init() { |
| 103 DCHECK(process_->HasConnection()); | 103 DCHECK(process_->HasConnection()); |
| 104 | 104 |
| 105 renderer_initialized_ = true; | 105 renderer_initialized_ = true; |
| 106 | 106 |
| 107 // Send the ack along with the information on placement. | 107 // Send the ack along with the information on placement. |
| 108 Send(new ViewMsg_CreatingNew_ACK(routing_id_, GetNativeViewId())); | 108 Send(new ViewMsg_CreatingNew_ACK(routing_id_, GetNativeViewId())); |
| 109 WasResized(); | 109 WasResized(); |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 | 866 |
| 867 // TODO(darin): do we need to do something else if our backing store is not | 867 // TODO(darin): do we need to do something else if our backing store is not |
| 868 // the same size as the advertised view? maybe we just assume there is a | 868 // the same size as the advertised view? maybe we just assume there is a |
| 869 // full paint on its way? | 869 // full paint on its way? |
| 870 BackingStore* backing_store = BackingStoreManager::Lookup(this); | 870 BackingStore* backing_store = BackingStoreManager::Lookup(this); |
| 871 if (!backing_store || (backing_store->size() != view_size)) | 871 if (!backing_store || (backing_store->size() != view_size)) |
| 872 return; | 872 return; |
| 873 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, | 873 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, |
| 874 dx, dy, clip_rect, view_size); | 874 dx, dy, clip_rect, view_size); |
| 875 } | 875 } |
| OLD | NEW |