| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
| 6 | 6 |
| 7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 // Don't update the cursor if a context menu is being shown. | 493 // Don't update the cursor if a context menu is being shown. |
| 494 if (IsShowingContextMenu()) | 494 if (IsShowingContextMenu()) |
| 495 return; | 495 return; |
| 496 | 496 |
| 497 // Can we synchronize to the event stream? Switch to -[NSWindow | 497 // Can we synchronize to the event stream? Switch to -[NSWindow |
| 498 // mouseLocationOutsideOfEventStream] if we cannot. TODO(avi): test and see | 498 // mouseLocationOutsideOfEventStream] if we cannot. TODO(avi): test and see |
| 499 NSEvent* event = [[cocoa_view_ window] currentEvent]; | 499 NSEvent* event = [[cocoa_view_ window] currentEvent]; |
| 500 if ([event window] != [cocoa_view_ window]) | 500 if ([event window] != [cocoa_view_ window]) |
| 501 return; | 501 return; |
| 502 | 502 |
| 503 NSCursor* ns_cursor = current_cursor_.GetCursor(); | 503 NSCursor* ns_cursor = current_cursor_.GetNativeCursor(); |
| 504 [ns_cursor set]; | 504 [ns_cursor set]; |
| 505 } | 505 } |
| 506 | 506 |
| 507 void RenderWidgetHostViewMac::SetIsLoading(bool is_loading) { | 507 void RenderWidgetHostViewMac::SetIsLoading(bool is_loading) { |
| 508 is_loading_ = is_loading; | 508 is_loading_ = is_loading; |
| 509 // If we ever decide to show the waiting cursor while the page is loading | 509 // If we ever decide to show the waiting cursor while the page is loading |
| 510 // like Chrome does on Windows, call |UpdateCursorIfNecessary()| here. | 510 // like Chrome does on Windows, call |UpdateCursorIfNecessary()| here. |
| 511 } | 511 } |
| 512 | 512 |
| 513 void RenderWidgetHostViewMac::TextInputStateChanged( | 513 void RenderWidgetHostViewMac::TextInputStateChanged( |
| (...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2763 if (!string) return NO; | 2763 if (!string) return NO; |
| 2764 | 2764 |
| 2765 // If the user is currently using an IME, confirm the IME input, | 2765 // If the user is currently using an IME, confirm the IME input, |
| 2766 // and then insert the text from the service, the same as TextEdit and Safari. | 2766 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2767 [self confirmComposition]; | 2767 [self confirmComposition]; |
| 2768 [self insertText:string]; | 2768 [self insertText:string]; |
| 2769 return YES; | 2769 return YES; |
| 2770 } | 2770 } |
| 2771 | 2771 |
| 2772 @end | 2772 @end |
| OLD | NEW |