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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm

Issue 6542027: Out of line cleanups for Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Killer rebase. :( Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/autocomplete/autocomplete_edit_view_mac.h" 5 #include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h"
6 6
7 #include <Carbon/Carbon.h> // kVK_Return 7 #include <Carbon/Carbon.h> // kVK_Return
8 8
9 #include "app/mac/nsimage_cache.h" 9 #include "app/mac/nsimage_cache.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // Destroy popup view before this object in case it tries to call us 200 // Destroy popup view before this object in case it tries to call us
201 // back in the destructor. Likewise for destroying the model before 201 // back in the destructor. Likewise for destroying the model before
202 // this object. 202 // this object.
203 popup_view_.reset(); 203 popup_view_.reset();
204 model_.reset(); 204 model_.reset();
205 205
206 // Disconnect from |field_|, it outlives this object. 206 // Disconnect from |field_|, it outlives this object.
207 [field_ setObserver:NULL]; 207 [field_ setObserver:NULL];
208 } 208 }
209 209
210 AutocompleteEditModel* AutocompleteEditViewMac::model() {
211 return model_.get();
212 }
213
214 const AutocompleteEditModel* AutocompleteEditViewMac::model() const {
215 return model_.get();
216 }
217
210 void AutocompleteEditViewMac::SaveStateToTab(TabContents* tab) { 218 void AutocompleteEditViewMac::SaveStateToTab(TabContents* tab) {
211 DCHECK(tab); 219 DCHECK(tab);
212 220
213 const bool hasFocus = [field_ currentEditor] ? true : false; 221 const bool hasFocus = [field_ currentEditor] ? true : false;
214 222
215 NSRange range; 223 NSRange range;
216 if (hasFocus) { 224 if (hasFocus) {
217 range = GetSelectedRange(); 225 range = GetSelectedRange();
218 } else { 226 } else {
219 // If we are not focussed, there is no selection. Manufacture 227 // If we are not focussed, there is no selection. Manufacture
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 1117
1110 void AutocompleteEditViewMac::PlaceCaretAt(NSUInteger pos) { 1118 void AutocompleteEditViewMac::PlaceCaretAt(NSUInteger pos) {
1111 DCHECK(pos <= GetTextLength()); 1119 DCHECK(pos <= GetTextLength());
1112 SetSelectedRange(NSMakeRange(pos, pos)); 1120 SetSelectedRange(NSMakeRange(pos, pos));
1113 } 1121 }
1114 1122
1115 bool AutocompleteEditViewMac::IsCaretAtEnd() const { 1123 bool AutocompleteEditViewMac::IsCaretAtEnd() const {
1116 const NSRange selection = GetSelectedRange(); 1124 const NSRange selection = GetSelectedRange();
1117 return selection.length == 0 && selection.location == GetTextLength(); 1125 return selection.length == 0 && selection.location == GetTextLength();
1118 } 1126 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_mac.h ('k') | chrome/browser/mach_broker_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698