| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ui/views/cocoa/bridged_content_view.h" | 5 #import "ui/views/cocoa/bridged_content_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/mac/mac_util.h" | 8 #import "base/mac/mac_util.h" |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
| (...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1405 // Add a black underline with a transparent background to the composition | 1405 // Add a black underline with a transparent background to the composition |
| 1406 // text. TODO(karandeepb): On Cocoa textfields, the target clause of the | 1406 // text. TODO(karandeepb): On Cocoa textfields, the target clause of the |
| 1407 // composition has a thick underlines. The composition text also has | 1407 // composition has a thick underlines. The composition text also has |
| 1408 // discontinous underlines for different clauses. This is also supported in | 1408 // discontinous underlines for different clauses. This is also supported in |
| 1409 // the Chrome renderer. Add code to extract underlines from |text| once our | 1409 // the Chrome renderer. Add code to extract underlines from |text| once our |
| 1410 // render text implementation supports thick underlines and discontinous | 1410 // render text implementation supports thick underlines and discontinous |
| 1411 // underlines for consecutive characters. See http://crbug.com/612675. | 1411 // underlines for consecutive characters. See http://crbug.com/612675. |
| 1412 composition.underlines.push_back(ui::CompositionUnderline( | 1412 composition.underlines.push_back(ui::CompositionUnderline( |
| 1413 0, [text length], SK_ColorBLACK, false, SK_ColorTRANSPARENT)); | 1413 0, [text length], SK_ColorBLACK, false, SK_ColorTRANSPARENT)); |
| 1414 textInputClient_->SetCompositionText(composition); | 1414 textInputClient_->SetCompositionText(composition); |
| 1415 keyDownEvent_ = nil; // Handled. |
| 1415 } | 1416 } |
| 1416 | 1417 |
| 1417 - (void)unmarkText { | 1418 - (void)unmarkText { |
| 1418 if (textInputClient_) | 1419 if (!textInputClient_) |
| 1419 textInputClient_->ConfirmCompositionText(); | 1420 return; |
| 1421 |
| 1422 textInputClient_->ConfirmCompositionText(); |
| 1423 keyDownEvent_ = nil; // Handled. |
| 1420 } | 1424 } |
| 1421 | 1425 |
| 1422 - (NSArray*)validAttributesForMarkedText { | 1426 - (NSArray*)validAttributesForMarkedText { |
| 1423 return @[]; | 1427 return @[]; |
| 1424 } | 1428 } |
| 1425 | 1429 |
| 1426 // NSUserInterfaceValidations protocol implementation. | 1430 // NSUserInterfaceValidations protocol implementation. |
| 1427 | 1431 |
| 1428 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { | 1432 - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item { |
| 1429 ui::TextEditCommand command = GetTextEditCommandForMenuAction([item action]); | 1433 ui::TextEditCommand command = GetTextEditCommandForMenuAction([item action]); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1480 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 1477 } | 1481 } |
| 1478 | 1482 |
| 1479 - (id)accessibilityFocusedUIElement { | 1483 - (id)accessibilityFocusedUIElement { |
| 1480 if (!hostedView_) | 1484 if (!hostedView_) |
| 1481 return nil; | 1485 return nil; |
| 1482 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; | 1486 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; |
| 1483 } | 1487 } |
| 1484 | 1488 |
| 1485 @end | 1489 @end |
| OLD | NEW |