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

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

Issue 194110: Convert the AutocompletePopupPositioner into a BubblePositioner in preparatio... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "app/gfx/font.h" 8 #include "app/gfx/font.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "base/clipboard.h" 10 #include "base/clipboard.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 - initWithEditView:(AutocompleteEditViewMac*)view; 132 - initWithEditView:(AutocompleteEditViewMac*)view;
133 - (void)windowDidResignKey:(NSNotification*)notification; 133 - (void)windowDidResignKey:(NSNotification*)notification;
134 @end 134 @end
135 135
136 // TODO(shess): AutocompletePopupViewMac doesn't really need an 136 // TODO(shess): AutocompletePopupViewMac doesn't really need an
137 // NSTextField. It wants to know where the position the popup, what 137 // NSTextField. It wants to know where the position the popup, what
138 // font to use, and it also needs to be able to attach the popup to 138 // font to use, and it also needs to be able to attach the popup to
139 // the window |field_| is in. 139 // the window |field_| is in.
140 AutocompleteEditViewMac::AutocompleteEditViewMac( 140 AutocompleteEditViewMac::AutocompleteEditViewMac(
141 AutocompleteEditController* controller, 141 AutocompleteEditController* controller,
142 AutocompletePopupPositioner* positioner, 142 const BubblePositioner* bubble_positioner,
143 ToolbarModel* toolbar_model, 143 ToolbarModel* toolbar_model,
144 Profile* profile, 144 Profile* profile,
145 CommandUpdater* command_updater, 145 CommandUpdater* command_updater,
146 AutocompleteTextField* field) 146 AutocompleteTextField* field)
147 : model_(new AutocompleteEditModel(this, controller, profile)), 147 : model_(new AutocompleteEditModel(this, controller, profile)),
148 popup_view_(new AutocompletePopupViewMac(this, model_.get(), positioner, 148 popup_view_(new AutocompletePopupViewMac(
149 profile, field)), 149 this, model_.get(), bubble_positioner, profile, field)),
150 controller_(controller), 150 controller_(controller),
151 toolbar_model_(toolbar_model), 151 toolbar_model_(toolbar_model),
152 command_updater_(command_updater), 152 command_updater_(command_updater),
153 field_(field), 153 field_(field),
154 edit_helper_([[AutocompleteFieldDelegate alloc] initWithEditView:this]) { 154 edit_helper_([[AutocompleteFieldDelegate alloc] initWithEditView:this]) {
155 DCHECK(controller); 155 DCHECK(controller);
156 DCHECK(toolbar_model); 156 DCHECK(toolbar_model);
157 DCHECK(profile); 157 DCHECK(profile);
158 DCHECK(command_updater); 158 DCHECK(command_updater);
159 DCHECK(field); 159 DCHECK(field);
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 // prepended and ".com" appended. This calls down to 847 // prepended and ".com" appended. This calls down to
848 // AutocompleteEditModel::OnControlKeyChanged() so that it can change 848 // AutocompleteEditModel::OnControlKeyChanged() so that it can change
849 // the popup to reflect this. See autocomplete_edit.cc 849 // the popup to reflect this. See autocomplete_edit.cc
850 // OnControlKeyChanged() and OnAfterPossibleChange(). 850 // OnControlKeyChanged() and OnAfterPossibleChange().
851 - (void)control:(NSControl*)control flagsChanged:(NSEvent*)theEvent { 851 - (void)control:(NSControl*)control flagsChanged:(NSEvent*)theEvent {
852 bool controlFlag = ([theEvent modifierFlags]&NSControlKeyMask) != 0; 852 bool controlFlag = ([theEvent modifierFlags]&NSControlKeyMask) != 0;
853 edit_view_->OnControlKeyChanged(controlFlag); 853 edit_view_->OnControlKeyChanged(controlFlag);
854 } 854 }
855 855
856 @end 856 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698