| 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 void RenderWidgetHost::NotifyTextDirection() { | 417 void RenderWidgetHost::NotifyTextDirection() { |
| 418 if (text_direction_updated_) { | 418 if (text_direction_updated_) { |
| 419 if (!text_direction_canceled_) | 419 if (!text_direction_canceled_) |
| 420 Send(new ViewMsg_SetTextDirection(routing_id(), | 420 Send(new ViewMsg_SetTextDirection(routing_id(), |
| 421 static_cast<int>(text_direction_))); | 421 static_cast<int>(text_direction_))); |
| 422 text_direction_updated_ = false; | 422 text_direction_updated_ = false; |
| 423 text_direction_canceled_ = false; | 423 text_direction_canceled_ = false; |
| 424 } | 424 } |
| 425 } | 425 } |
| 426 | 426 |
| 427 void RenderWidgetHost::ImeSetInputMode(bool activate) { |
| 428 Send(new ViewMsg_ImeSetInputMode(routing_id(), activate)); |
| 429 } |
| 430 |
| 431 void RenderWidgetHost::ImeSetComposition(const std::wstring& ime_string, |
| 432 int cursor_position, |
| 433 int target_start, |
| 434 int target_end) { |
| 435 Send(new ViewMsg_ImeSetComposition(routing_id(), 0, cursor_position, |
| 436 target_start, target_end, ime_string)); |
| 437 } |
| 438 |
| 439 void RenderWidgetHost::ImeConfirmComposition(const std::wstring& ime_string) { |
| 440 Send(new ViewMsg_ImeSetComposition(routing_id(), 1, -1, -1, -1, ime_string)); |
| 441 } |
| 442 |
| 443 void RenderWidgetHost::ImeCancelComposition() { |
| 444 std::wstring empty_string; |
| 445 Send(new ViewMsg_ImeSetComposition(routing_id(), -1, -1, -1, -1, |
| 446 empty_string)); |
| 447 } |
| 448 |
| 427 gfx::Rect RenderWidgetHost::GetRootWindowResizerRect() const { | 449 gfx::Rect RenderWidgetHost::GetRootWindowResizerRect() const { |
| 428 return gfx::Rect(); | 450 return gfx::Rect(); |
| 429 } | 451 } |
| 430 | 452 |
| 431 void RenderWidgetHost::Destroy() { | 453 void RenderWidgetHost::Destroy() { |
| 432 NotificationService::current()->Notify( | 454 NotificationService::current()->Notify( |
| 433 NotificationType::RENDER_WIDGET_HOST_DESTROYED, | 455 NotificationType::RENDER_WIDGET_HOST_DESTROYED, |
| 434 Source<RenderWidgetHost>(this), | 456 Source<RenderWidgetHost>(this), |
| 435 NotificationService::NoDetails()); | 457 NotificationService::NoDetails()); |
| 436 | 458 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 | 785 |
| 764 // TODO(darin): do we need to do something else if our backing store is not | 786 // TODO(darin): do we need to do something else if our backing store is not |
| 765 // the same size as the advertised view? maybe we just assume there is a | 787 // the same size as the advertised view? maybe we just assume there is a |
| 766 // full paint on its way? | 788 // full paint on its way? |
| 767 BackingStore* backing_store = BackingStoreManager::Lookup(this); | 789 BackingStore* backing_store = BackingStoreManager::Lookup(this); |
| 768 if (!backing_store || (backing_store->size() != view_size)) | 790 if (!backing_store || (backing_store->size() != view_size)) |
| 769 return; | 791 return; |
| 770 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, | 792 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, |
| 771 dx, dy, clip_rect, view_size); | 793 dx, dy, clip_rect, view_size); |
| 772 } | 794 } |
| OLD | NEW |