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/views/autofill/autofill_dialog_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/autofill/wallet/wallet_service_url.h" | 10 #include "chrome/browser/autofill/wallet/wallet_service_url.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 set_background(NULL); | 159 set_background(NULL); |
160 } | 160 } |
161 | 161 |
162 void AutofillDialogViews::SectionContainer::OnMouseEntered( | 162 void AutofillDialogViews::SectionContainer::OnMouseEntered( |
163 const ui::MouseEvent& event) { | 163 const ui::MouseEvent& event) { |
164 if (!forward_mouse_events_) | 164 if (!forward_mouse_events_) |
165 return; | 165 return; |
166 | 166 |
167 // TODO(estade): use the correct color. | 167 // TODO(estade): use the correct color. |
168 set_background(views::Background::CreateSolidBackground(SK_ColorLTGRAY)); | 168 set_background(views::Background::CreateSolidBackground(SK_ColorLTGRAY)); |
169 proxy_button_->OnMouseEntered(ProxyEvent(event)); | 169 ui::MouseEvent event_copy(event); |
sky
2013/01/28 19:10:55
Is there a reason for doing these changes? Seems l
DaveMoore
2013/01/28 23:25:20
When I made the MouseEvent() constructor explicit
| |
170 event_copy.set_location(gfx::Point()); | |
171 proxy_button_->OnMouseEntered(event_copy); | |
170 SchedulePaint(); | 172 SchedulePaint(); |
171 } | 173 } |
172 | 174 |
173 void AutofillDialogViews::SectionContainer::OnMouseExited( | 175 void AutofillDialogViews::SectionContainer::OnMouseExited( |
174 const ui::MouseEvent& event) { | 176 const ui::MouseEvent& event) { |
175 if (!forward_mouse_events_) | 177 if (!forward_mouse_events_) |
176 return; | 178 return; |
177 | 179 |
178 set_background(NULL); | 180 set_background(NULL); |
179 proxy_button_->OnMouseExited(ProxyEvent(event)); | 181 ui::MouseEvent event_copy(event); |
182 event_copy.set_location(gfx::Point()); | |
183 proxy_button_->OnMouseExited(event_copy); | |
180 SchedulePaint(); | 184 SchedulePaint(); |
181 } | 185 } |
182 | 186 |
183 bool AutofillDialogViews::SectionContainer::OnMousePressed( | 187 bool AutofillDialogViews::SectionContainer::OnMousePressed( |
184 const ui::MouseEvent& event) { | 188 const ui::MouseEvent& event) { |
185 if (!forward_mouse_events_) | 189 if (!forward_mouse_events_) |
186 return false; | 190 return false; |
187 | 191 |
188 return proxy_button_->OnMousePressed(ProxyEvent(event)); | 192 ui::MouseEvent event_copy(event); |
193 event_copy.set_location(gfx::Point()); | |
194 return proxy_button_->OnMousePressed(event_copy); | |
189 } | 195 } |
190 | 196 |
191 void AutofillDialogViews::SectionContainer::OnMouseReleased( | 197 void AutofillDialogViews::SectionContainer::OnMouseReleased( |
192 const ui::MouseEvent& event) { | 198 const ui::MouseEvent& event) { |
193 if (!forward_mouse_events_) | 199 if (!forward_mouse_events_) |
194 return; | 200 return; |
195 | 201 |
196 proxy_button_->OnMouseReleased(ProxyEvent(event)); | 202 ui::MouseEvent event_copy(event); |
197 } | |
198 | |
199 // static | |
200 ui::MouseEvent AutofillDialogViews::SectionContainer::ProxyEvent( | |
201 const ui::MouseEvent& event) { | |
202 ui::MouseEvent event_copy = event; | |
203 event_copy.set_location(gfx::Point()); | 203 event_copy.set_location(gfx::Point()); |
204 return event_copy; | 204 proxy_button_->OnMouseReleased(event_copy); |
205 } | 205 } |
206 | 206 |
207 // AutofilDialogViews::SuggestionView ------------------------------------------ | 207 // AutofilDialogViews::SuggestionView ------------------------------------------ |
208 | 208 |
209 AutofillDialogViews::SuggestionView::SuggestionView( | 209 AutofillDialogViews::SuggestionView::SuggestionView( |
210 const string16& edit_label, | 210 const string16& edit_label, |
211 views::LinkListener* edit_listener) | 211 views::LinkListener* edit_listener) |
212 : label_(new views::Label()), | 212 : label_(new views::Label()), |
213 icon_(new views::ImageView()), | 213 icon_(new views::ImageView()), |
214 label_container_(new views::View()) { | 214 label_container_(new views::View()) { |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
835 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 835 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
836 : section(section), | 836 : section(section), |
837 container(NULL), | 837 container(NULL), |
838 manual_input(NULL), | 838 manual_input(NULL), |
839 suggested_info(NULL), | 839 suggested_info(NULL), |
840 suggested_button(NULL) {} | 840 suggested_button(NULL) {} |
841 | 841 |
842 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 842 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
843 | 843 |
844 } // namespace autofill | 844 } // namespace autofill |
OLD | NEW |