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 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2625 if (!string) return NO; | 2627 if (!string) return NO; |
2626 | 2628 |
2627 // If the user is currently using an IME, confirm the IME input, | 2629 // If the user is currently using an IME, confirm the IME input, |
2628 // and then insert the text from the service, the same as TextEdit and Safari. | 2630 // and then insert the text from the service, the same as TextEdit and Safari. |
2629 [self confirmComposition]; | 2631 [self confirmComposition]; |
2630 [self insertText:string]; | 2632 [self insertText:string]; |
2631 return YES; | 2633 return YES; |
2632 } | 2634 } |
2633 | 2635 |
2634 @end | 2636 @end |
OLD | NEW |