| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <QuartzCore/QuartzCore.h> | 5 #include <QuartzCore/QuartzCore.h> |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 NSString* tooltip_nsstring = base::SysWideToNSString(display_text); | 637 NSString* tooltip_nsstring = base::SysWideToNSString(display_text); |
| 638 [cocoa_view_ setToolTipAtMousePoint:tooltip_nsstring]; | 638 [cocoa_view_ setToolTipAtMousePoint:tooltip_nsstring]; |
| 639 } | 639 } |
| 640 } | 640 } |
| 641 | 641 |
| 642 // | 642 // |
| 643 // RenderWidgetHostViewCocoa uses the stored selection text, | 643 // RenderWidgetHostViewCocoa uses the stored selection text, |
| 644 // which implements NSServicesRequests protocol. | 644 // which implements NSServicesRequests protocol. |
| 645 // | 645 // |
| 646 void RenderWidgetHostViewMac::SelectionChanged(const std::string& text, | 646 void RenderWidgetHostViewMac::SelectionChanged(const std::string& text, |
| 647 const ui::Range& range) { | 647 const ui::Range& range, |
| 648 const gfx::Point& start, |
| 649 const gfx::Point& end) { |
| 648 selected_text_ = text; | 650 selected_text_ = text; |
| 649 [cocoa_view_ setSelectedRange:range.ToNSRange()]; | 651 [cocoa_view_ setSelectedRange:range.ToNSRange()]; |
| 650 // Updaes markedRange when there is no marked text so that retrieving | 652 // Updaes markedRange when there is no marked text so that retrieving |
| 651 // markedRange immediately after calling setMarkdText: returns the current | 653 // markedRange immediately after calling setMarkdText: returns the current |
| 652 // caret position. | 654 // caret position. |
| 653 if (![cocoa_view_ hasMarkedText]) { | 655 if (![cocoa_view_ hasMarkedText]) { |
| 654 [cocoa_view_ setMarkedRange:range.ToNSRange()]; | 656 [cocoa_view_ setMarkedRange:range.ToNSRange()]; |
| 655 } | 657 } |
| 656 } | 658 } |
| 657 | 659 |
| (...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2628 if (!string) return NO; | 2630 if (!string) return NO; |
| 2629 | 2631 |
| 2630 // If the user is currently using an IME, confirm the IME input, | 2632 // If the user is currently using an IME, confirm the IME input, |
| 2631 // and then insert the text from the service, the same as TextEdit and Safari. | 2633 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2632 [self confirmComposition]; | 2634 [self confirmComposition]; |
| 2633 [self insertText:string]; | 2635 [self insertText:string]; |
| 2634 return YES; | 2636 return YES; |
| 2635 } | 2637 } |
| 2636 | 2638 |
| 2637 @end | 2639 @end |
| OLD | NEW |