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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 void AutofillPopupControllerImpl::SelectionCleared() { | 280 void AutofillPopupControllerImpl::SelectionCleared() { |
281 SetSelectedLine(kNoSelection); | 281 SetSelectedLine(kNoSelection); |
282 } | 282 } |
283 | 283 |
284 void AutofillPopupControllerImpl::AcceptSuggestion(size_t index) { | 284 void AutofillPopupControllerImpl::AcceptSuggestion(size_t index) { |
285 const autofill::Suggestion& suggestion = suggestions_[index]; | 285 const autofill::Suggestion& suggestion = suggestions_[index]; |
286 delegate_->DidAcceptSuggestion(suggestion.value, suggestion.frontend_id, | 286 delegate_->DidAcceptSuggestion(suggestion.value, suggestion.frontend_id, |
287 index); | 287 index); |
288 } | 288 } |
289 | 289 |
290 bool AutofillPopupControllerImpl::IsWarning(size_t index) const { | |
291 return suggestions_[index].frontend_id == | |
292 POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE || | |
293 suggestions_[index].frontend_id == | |
294 POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE; | |
295 } | |
296 | |
297 gfx::Rect AutofillPopupControllerImpl::popup_bounds() const { | 290 gfx::Rect AutofillPopupControllerImpl::popup_bounds() const { |
298 return layout_model_.popup_bounds(); | 291 return layout_model_.popup_bounds(); |
299 } | 292 } |
300 | 293 |
301 content::WebContents* AutofillPopupControllerImpl::web_contents() { | 294 content::WebContents* AutofillPopupControllerImpl::web_contents() { |
302 return controller_common_->web_contents(); | 295 return controller_common_->web_contents(); |
303 } | 296 } |
304 | 297 |
305 gfx::NativeView AutofillPopupControllerImpl::container_view() { | 298 gfx::NativeView AutofillPopupControllerImpl::container_view() { |
306 return controller_common_->container_view(); | 299 return controller_common_->container_view(); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 // Don't clear view_, because otherwise the popup will have to get regenerated | 529 // Don't clear view_, because otherwise the popup will have to get regenerated |
537 // and this will cause flickering. | 530 // and this will cause flickering. |
538 suggestions_.clear(); | 531 suggestions_.clear(); |
539 elided_values_.clear(); | 532 elided_values_.clear(); |
540 elided_labels_.clear(); | 533 elided_labels_.clear(); |
541 | 534 |
542 selected_line_ = kNoSelection; | 535 selected_line_ = kNoSelection; |
543 } | 536 } |
544 | 537 |
545 } // namespace autofill | 538 } // namespace autofill |
OLD | NEW |