| 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 <algorithm> |    7 #include <algorithm> | 
|    8 #include <utility> |    8 #include <utility> | 
|    9  |    9  | 
|   10 #include "base/logging.h" |   10 #include "base/logging.h" | 
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  335   return delegate_->ShouldRepostEvent(event); |  335   return delegate_->ShouldRepostEvent(event); | 
|  336 } |  336 } | 
|  337  |  337  | 
|  338 void AutofillPopupControllerImpl::AcceptSuggestion(size_t index) { |  338 void AutofillPopupControllerImpl::AcceptSuggestion(size_t index) { | 
|  339   delegate_->DidAcceptSuggestion(full_names_[index], identifiers_[index]); |  339   delegate_->DidAcceptSuggestion(full_names_[index], identifiers_[index]); | 
|  340 } |  340 } | 
|  341  |  341  | 
|  342 int AutofillPopupControllerImpl::GetIconResourceID( |  342 int AutofillPopupControllerImpl::GetIconResourceID( | 
|  343     const base::string16& resource_name) const { |  343     const base::string16& resource_name) const { | 
|  344   for (size_t i = 0; i < arraysize(kDataResources); ++i) { |  344   for (size_t i = 0; i < arraysize(kDataResources); ++i) { | 
|  345     if (resource_name == ASCIIToUTF16(kDataResources[i].name)) |  345     if (resource_name == base::ASCIIToUTF16(kDataResources[i].name)) | 
|  346       return kDataResources[i].id; |  346       return kDataResources[i].id; | 
|  347   } |  347   } | 
|  348  |  348  | 
|  349   return -1; |  349   return -1; | 
|  350 } |  350 } | 
|  351  |  351  | 
|  352 bool AutofillPopupControllerImpl::CanDelete(size_t index) const { |  352 bool AutofillPopupControllerImpl::CanDelete(size_t index) const { | 
|  353   // TODO(isherman): Native AddressBook suggestions on Mac and Android should |  353   // TODO(isherman): Native AddressBook suggestions on Mac and Android should | 
|  354   // not be considered to be deleteable. |  354   // not be considered to be deleteable. | 
|  355   int id = identifiers_[index]; |  355   int id = identifiers_[index]; | 
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  764     // The popup can appear below the field. |  764     // The popup can appear below the field. | 
|  765     return std::make_pair(bottom_growth_start, popup_required_height); |  765     return std::make_pair(bottom_growth_start, popup_required_height); | 
|  766   } else { |  766   } else { | 
|  767     // The popup must appear above the field. |  767     // The popup must appear above the field. | 
|  768     return std::make_pair(top_growth_end - popup_required_height, |  768     return std::make_pair(top_growth_end - popup_required_height, | 
|  769                           popup_required_height); |  769                           popup_required_height); | 
|  770   } |  770   } | 
|  771 } |  771 } | 
|  772  |  772  | 
|  773 }  // namespace autofill |  773 }  // namespace autofill | 
| OLD | NEW |