| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |