| 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 "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" | 5 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> // kVK_Return | 7 #include <Carbon/Carbon.h> // kVK_Return |
| 8 | 8 |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/sys_string_conversions.h" | 11 #include "base/strings/sys_string_conversions.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/autocomplete/autocomplete_input.h" | 13 #include "chrome/browser/autocomplete/autocomplete_input.h" |
| 14 #include "chrome/browser/autocomplete/autocomplete_match.h" | 14 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/search/search.h" | 16 #include "chrome/browser/search/search.h" |
| 17 #include "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" | 17 #include "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" |
| 18 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" | 18 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" |
| 19 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h" | 19 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h" |
| 20 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 20 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 | 966 |
| 967 NSUInteger OmniboxViewMac::GetTextLength() const { | 967 NSUInteger OmniboxViewMac::GetTextLength() const { |
| 968 return [field_ currentEditor] ? [[[field_ currentEditor] string] length] : | 968 return [field_ currentEditor] ? [[[field_ currentEditor] string] length] : |
| 969 [[field_ stringValue] length]; | 969 [[field_ stringValue] length]; |
| 970 } | 970 } |
| 971 | 971 |
| 972 bool OmniboxViewMac::IsCaretAtEnd() const { | 972 bool OmniboxViewMac::IsCaretAtEnd() const { |
| 973 const NSRange selection = GetSelectedRange(); | 973 const NSRange selection = GetSelectedRange(); |
| 974 return NSMaxRange(selection) == GetTextLength(); | 974 return NSMaxRange(selection) == GetTextLength(); |
| 975 } | 975 } |
| OLD | NEW |