| 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/autofill/autocomplete_history_manager.h" | 6 #include "chrome/browser/autofill/autocomplete_history_manager.h" |
| 7 #include "chrome/browser/autofill/autofill_external_delegate.h" | 7 #include "chrome/browser/autofill/autofill_external_delegate.h" |
| 8 #include "chrome/browser/autofill/autofill_manager.h" | 8 #include "chrome/browser/autofill/autofill_manager.h" |
| 9 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 9 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| 10 #include "chrome/common/autofill_messages.h" | 10 #include "chrome/common/autofill_messages.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 std::vector<string16> empty(suggestions.size()); | 153 std::vector<string16> empty(suggestions.size()); |
| 154 std::vector<int> password_ids(suggestions.size(), | 154 std::vector<int> password_ids(suggestions.size(), |
| 155 WebAutofillClient::MenuItemIDPasswordEntry); | 155 WebAutofillClient::MenuItemIDPasswordEntry); |
| 156 ApplyAutofillSuggestions(suggestions, empty, empty, password_ids); | 156 ApplyAutofillSuggestions(suggestions, empty, empty, password_ids); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void AutofillExternalDelegate::EnsurePopupForElement( | 159 void AutofillExternalDelegate::EnsurePopupForElement( |
| 160 const gfx::RectF& element_bounds) { | 160 const gfx::RectF& element_bounds) { |
| 161 // Convert element_bounds to be in screen space. | 161 // Convert element_bounds to be in screen space. |
| 162 gfx::Rect client_area; | 162 gfx::Rect client_area; |
| 163 web_contents_->GetContainerBounds(&client_area); | 163 web_contents_->GetView()->GetContainerBounds(&client_area); |
| 164 gfx::RectF element_bounds_in_screen_space = | 164 gfx::RectF element_bounds_in_screen_space = |
| 165 element_bounds + client_area.OffsetFromOrigin(); | 165 element_bounds + client_area.OffsetFromOrigin(); |
| 166 | 166 |
| 167 // |controller_| owns itself. | 167 // |controller_| owns itself. |
| 168 controller_ = AutofillPopupControllerImpl::GetOrCreate( | 168 controller_ = AutofillPopupControllerImpl::GetOrCreate( |
| 169 controller_, | 169 controller_, |
| 170 this, | 170 this, |
| 171 web_contents()->GetView()->GetContentNativeView(), | 171 web_contents()->GetView()->GetContentNativeView(), |
| 172 element_bounds_in_screen_space); | 172 element_bounds_in_screen_space); |
| 173 } | 173 } |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 const content::NotificationDetails& details) { | 409 const content::NotificationDetails& details) { |
| 410 if (type == content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED) { | 410 if (type == content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED) { |
| 411 if (!*content::Details<bool>(details).ptr()) | 411 if (!*content::Details<bool>(details).ptr()) |
| 412 HideAutofillPopup(); | 412 HideAutofillPopup(); |
| 413 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { | 413 } else if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { |
| 414 HideAutofillPopup(); | 414 HideAutofillPopup(); |
| 415 } else { | 415 } else { |
| 416 NOTREACHED(); | 416 NOTREACHED(); |
| 417 } | 417 } |
| 418 } | 418 } |
| OLD | NEW |