Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Side by Side Diff: ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm

Issue 2891653003: [omnibox] Break out SetCaretPos() method and enhance browser test (Closed)
Patch Set: Fixed range on Cocoa Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/omnibox/omnibox_view_ios.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ios/chrome/browser/ui/omnibox/omnibox_view_ios.h" 5 #include "ios/chrome/browser/ui/omnibox/omnibox_view_ios.h"
6 6
7 #import <CoreText/CoreText.h> 7 #import <CoreText/CoreText.h>
8 #import <MobileCoreServices/MobileCoreServices.h> 8 #import <MobileCoreServices/MobileCoreServices.h>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 NSAttributedString* as = ApplyTextAttributes(text); 235 NSAttributedString* as = ApplyTextAttributes(text);
236 [field_ setText:as userTextLength:[as length]]; 236 [field_ setText:as userTextLength:[as length]];
237 237
238 if (update_popup) 238 if (update_popup)
239 UpdatePopup(); 239 UpdatePopup();
240 240
241 if (notify_text_changed) 241 if (notify_text_changed)
242 model()->OnChanged(); 242 model()->OnChanged();
243 } 243 }
244 244
245 // TODO(crbug.com/726702): Implement this and have |SetWindowTextAndCaretPos()|
246 // call it.
247 void OmniboxViewIOS::SetCaretPos(size_t caret_pos) {}
248
245 void OmniboxViewIOS::RevertAll() { 249 void OmniboxViewIOS::RevertAll() {
246 ignore_popup_updates_ = true; 250 ignore_popup_updates_ = true;
247 OmniboxView::RevertAll(); 251 OmniboxView::RevertAll();
248 ignore_popup_updates_ = false; 252 ignore_popup_updates_ = false;
249 } 253 }
250 254
251 void OmniboxViewIOS::UpdatePopup() { 255 void OmniboxViewIOS::UpdatePopup() {
252 model()->SetInputInProgress(true); 256 model()->SetInputInProgress(true);
253 257
254 if (!model()->has_focus()) 258 if (!model()->has_focus())
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 // is being left out for now because it was not present before the OmniboxView 889 // is being left out for now because it was not present before the OmniboxView
886 // rewrite. 890 // rewrite.
887 #if 0 891 #if 0
888 // When editing is in progress, the url text is not colored, so there is 892 // When editing is in progress, the url text is not colored, so there is
889 // nothing to emphasize. (Calling SetText() in that situation would also be 893 // nothing to emphasize. (Calling SetText() in that situation would also be
890 // harmful, as it would reset the carat position to the end of the text.) 894 // harmful, as it would reset the carat position to the end of the text.)
891 if (!IsEditingOrEmpty()) 895 if (!IsEditingOrEmpty())
892 SetText(GetText()); 896 SetText(GetText());
893 #endif 897 #endif
894 } 898 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/omnibox/omnibox_view_ios.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698