Merge revision 676 changes:

- Mac: Add IME support (issue #557).

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1025@677 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-06-07 18:44:21 +00:00
parent 962b2a254d
commit 6fc2dd37f9
2 changed files with 327 additions and 9 deletions

View File

@@ -8,7 +8,10 @@
#import <Cocoa/Cocoa.h>
#import "base/mac/cocoa_protocols.h"
#include "base/string16.h"
#include "base/memory/scoped_nsobject.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include <Vector>
class CefBrowserImpl;
@class WebDragSource;
@@ -18,7 +21,7 @@ struct WebDropData;
// A view to wrap the WebCore view and help it live in a Cocoa world. The
// (rough) equivalent of Apple's WebView.
@interface BrowserWebView : NSView {
@interface BrowserWebView : NSView<NSTextInputClient> {
@private
CefBrowserImpl* browser_; // weak
NSTrackingArea* trackingArea_;
@@ -26,6 +29,37 @@ struct WebDropData;
scoped_nsobject<WebDragSource> dragSource_;
scoped_nsobject<WebDropTarget> dropTarget_;
// Represents the input-method attributes supported by this object.
scoped_nsobject<NSArray> validAttributesForMarkedText_;
// Indicates if we are currently handling a key down event.
BOOL handlingKeyDown_;
// Indicates if there is any marked text.
BOOL hasMarkedText_;
// Indicates if unmarkText is called or not when handling a keyboard
// event.
BOOL unmarkTextCalled_;
// The range of current marked text inside the whole content of the DOM node
// being edited.
// TODO(suzhe): This is currently a fake value, as we do not support accessing
// the whole content yet.
NSRange markedRange_;
// The selected range, cached from a message sent by the renderer.
NSRange selectedRange_;
// Text to be inserted which was generated by handling a key down event.
string16 textToBeInserted_;
// Marked text which was generated by handling a key down event.
string16 markedText_;
// Underline information of the |markedText_|.
std::vector<WebKit::WebCompositionUnderline> underlines_;
}
- (void)mouseDown:(NSEvent *)theEvent;