| 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 | |
| 449 gfx::Rect RenderWidgetHost::GetRootWindowResizerRect() const { | 427 gfx::Rect RenderWidgetHost::GetRootWindowResizerRect() const { |
| 450 return gfx::Rect(); | 428 return gfx::Rect(); |
| 451 } | 429 } |
| 452 | 430 |
| 453 void RenderWidgetHost::Destroy() { | 431 void RenderWidgetHost::Destroy() { |
| 454 NotificationService::current()->Notify( | 432 NotificationService::current()->Notify( |
| 455 NotificationType::RENDER_WIDGET_HOST_DESTROYED, | 433 NotificationType::RENDER_WIDGET_HOST_DESTROYED, |
| 456 Source<RenderWidgetHost>(this), | 434 Source<RenderWidgetHost>(this), |
| 457 NotificationService::NoDetails()); | 435 NotificationService::NoDetails()); |
| 458 | 436 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 | 763 |
| 786 // TODO(darin): do we need to do something else if our backing store is not | 764 // TODO(darin): do we need to do something else if our backing store is not |
| 787 // the same size as the advertised view? maybe we just assume there is a | 765 // the same size as the advertised view? maybe we just assume there is a |
| 788 // full paint on its way? | 766 // full paint on its way? |
| 789 BackingStore* backing_store = BackingStoreManager::Lookup(this); | 767 BackingStore* backing_store = BackingStoreManager::Lookup(this); |
| 790 if (!backing_store || (backing_store->size() != view_size)) | 768 if (!backing_store || (backing_store->size() != view_size)) |
| 791 return; | 769 return; |
| 792 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, | 770 backing_store->ScrollRect(process_->process().handle(), bitmap, bitmap_rect, |
| 793 dx, dy, clip_rect, view_size); | 771 dx, dy, clip_rect, view_size); |
| 794 } | 772 } |
| OLD | NEW |