| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_autofill_client.h" | 5 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 9 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 const gfx::RectF& element_bounds, | 179 const gfx::RectF& element_bounds, |
| 180 base::i18n::TextDirection text_direction, | 180 base::i18n::TextDirection text_direction, |
| 181 const std::vector<autofill::Suggestion>& suggestions, | 181 const std::vector<autofill::Suggestion>& suggestions, |
| 182 base::WeakPtr<AutofillPopupDelegate> delegate) { | 182 base::WeakPtr<AutofillPopupDelegate> delegate) { |
| 183 // Convert element_bounds to be in screen space. | 183 // Convert element_bounds to be in screen space. |
| 184 gfx::Rect client_area = web_contents()->GetContainerBounds(); | 184 gfx::Rect client_area = web_contents()->GetContainerBounds(); |
| 185 gfx::RectF element_bounds_in_screen_space = | 185 gfx::RectF element_bounds_in_screen_space = |
| 186 element_bounds + client_area.OffsetFromOrigin(); | 186 element_bounds + client_area.OffsetFromOrigin(); |
| 187 | 187 |
| 188 // Will delete or reuse the old |popup_controller_|. | 188 // Will delete or reuse the old |popup_controller_|. |
| 189 popup_controller_ = AutofillPopupControllerImpl::GetOrCreate( | 189 popup_controller_ = |
| 190 popup_controller_, | 190 AutofillPopupControllerImpl::GetOrCreate(popup_controller_, |
| 191 delegate, | 191 delegate, |
| 192 web_contents(), | 192 web_contents(), |
| 193 web_contents()->GetContentNativeView(), | 193 web_contents()->GetNativeView(), |
| 194 element_bounds_in_screen_space, | 194 element_bounds_in_screen_space, |
| 195 text_direction); | 195 text_direction); |
| 196 | 196 |
| 197 popup_controller_->Show(suggestions); | 197 popup_controller_->Show(suggestions); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void ChromeAutofillClient::UpdateAutofillPopupDataListValues( | 200 void ChromeAutofillClient::UpdateAutofillPopupDataListValues( |
| 201 const std::vector<base::string16>& values, | 201 const std::vector<base::string16>& values, |
| 202 const std::vector<base::string16>& labels) { | 202 const std::vector<base::string16>& labels) { |
| 203 if (popup_controller_.get()) | 203 if (popup_controller_.get()) |
| 204 popup_controller_->UpdateDataListValues(values, labels); | 204 popup_controller_->UpdateDataListValues(values, labels); |
| 205 } | 205 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 new AutofillMsg_FirstUserGestureObservedInTab(routing_id())); | 283 new AutofillMsg_FirstUserGestureObservedInTab(routing_id())); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void ChromeAutofillClient::LinkClicked(const GURL& url, | 286 void ChromeAutofillClient::LinkClicked(const GURL& url, |
| 287 WindowOpenDisposition disposition) { | 287 WindowOpenDisposition disposition) { |
| 288 web_contents()->OpenURL(content::OpenURLParams( | 288 web_contents()->OpenURL(content::OpenURLParams( |
| 289 url, content::Referrer(), disposition, ui::PAGE_TRANSITION_LINK, false)); | 289 url, content::Referrer(), disposition, ui::PAGE_TRANSITION_LINK, false)); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace autofill | 292 } // namespace autofill |
| OLD | NEW |