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

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 11740033: [Autofill] Add Mac implementation for the in-browser process popup view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename _mac to _bridge, added TODOs for cleanup per Nico's comments. Created 7 years, 11 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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/autofill/autofill_popup_view.cc » ('j') | 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 "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" 5 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/ui/autofill/autofill_popup_delegate.h" 9 #include "chrome/browser/ui/autofill/autofill_popup_delegate.h"
10 #include "chrome/browser/ui/autofill/autofill_popup_view.h" 10 #include "chrome/browser/ui/autofill/autofill_popup_view.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 const string16& resource_name) { 184 const string16& resource_name) {
185 for (size_t i = 0; i < arraysize(kDataResources); ++i) { 185 for (size_t i = 0; i < arraysize(kDataResources); ++i) {
186 if (resource_name == ASCIIToUTF16(kDataResources[i].name)) 186 if (resource_name == ASCIIToUTF16(kDataResources[i].name))
187 return kDataResources[i].id; 187 return kDataResources[i].id;
188 } 188 }
189 189
190 return -1; 190 return -1;
191 } 191 }
192 192
193 bool AutofillPopupControllerImpl::CanDelete(size_t index) { 193 bool AutofillPopupControllerImpl::CanDelete(size_t index) {
194 // TODO(isherman): AddressBook suggestions on Mac should not be drawn as
195 // deleteable.
194 int id = identifiers_[index]; 196 int id = identifiers_[index];
195 return id > 0 || 197 return id > 0 ||
196 id == WebAutofillClient::MenuItemIDAutocompleteEntry || 198 id == WebAutofillClient::MenuItemIDAutocompleteEntry ||
197 id == WebAutofillClient::MenuItemIDPasswordEntry; 199 id == WebAutofillClient::MenuItemIDPasswordEntry;
198 } 200 }
199 201
200 #if !defined(OS_ANDROID) 202 #if !defined(OS_ANDROID)
201 int AutofillPopupControllerImpl::GetPopupRequiredWidth() { 203 int AutofillPopupControllerImpl::GetPopupRequiredWidth() {
202 if (name_font_.platform_font() == NULL || 204 if (name_font_.platform_font() == NULL ||
203 subtext_font_.platform_font() == NULL) { 205 subtext_font_.platform_font() == NULL) {
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 identifiers_[0] == WebAutofillClient::MenuItemIDDataListEntry); 499 identifiers_[0] == WebAutofillClient::MenuItemIDDataListEntry);
498 } 500 }
499 501
500 void AutofillPopupControllerImpl::ShowView() { 502 void AutofillPopupControllerImpl::ShowView() {
501 view_->Show(); 503 view_->Show();
502 } 504 }
503 505
504 void AutofillPopupControllerImpl::InvalidateRow(size_t row) { 506 void AutofillPopupControllerImpl::InvalidateRow(size_t row) {
505 view_->InvalidateRow(row); 507 view_->InvalidateRow(row);
506 } 508 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/autofill/autofill_popup_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698