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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/autofill/autofill_dialog_sign_in_delegate.h" | 13 #include "chrome/browser/ui/autofill/autofill_dialog_sign_in_delegate.h" |
14 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" | 14 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" |
15 #include "chrome/browser/ui/autofill/loading_animation.h" | 15 #include "chrome/browser/ui/autofill/loading_animation.h" |
16 #include "chrome/browser/ui/views/autofill/decorated_textfield.h" | 16 #include "chrome/browser/ui/views/autofill/decorated_textfield.h" |
17 #include "chrome/browser/ui/views/constrained_window_views.h" | 17 #include "chrome/browser/ui/views/constrained_window_views.h" |
18 #include "components/autofill/content/browser/wallet/wallet_service_url.h" | 18 #include "components/autofill/content/browser/wallet/wallet_service_url.h" |
19 #include "components/autofill/core/browser/autofill_type.h" | 19 #include "components/autofill/core/browser/autofill_type.h" |
20 #include "components/web_modal/web_contents_modal_dialog_host.h" | 20 #include "components/web_modal/web_contents_modal_dialog_host.h" |
21 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 21 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
22 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 22 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
23 #include "content/public/browser/native_web_keyboard_event.h" | 23 #include "content/public/browser/native_web_keyboard_event.h" |
24 #include "content/public/browser/navigation_controller.h" | 24 #include "content/public/browser/navigation_controller.h" |
25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
26 #include "content/public/browser/web_contents_view.h" | 26 #include "content/public/browser/web_contents_view.h" |
27 #include "grit/theme_resources.h" | 27 #include "grit/theme_resources.h" |
28 #include "grit/ui_resources.h" | 28 #include "grit/ui_resources.h" |
29 #include "third_party/skia/include/core/SkColor.h" | 29 #include "third_party/skia/include/core/SkColor.h" |
30 #include "ui/base/animation/animation_delegate.h" | |
31 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
32 #include "ui/base/models/combobox_model.h" | 31 #include "ui/base/models/combobox_model.h" |
33 #include "ui/base/models/menu_model.h" | 32 #include "ui/base/models/menu_model.h" |
34 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 #include "ui/gfx/animation/animation_delegate.h" |
35 #include "ui/gfx/canvas.h" | 35 #include "ui/gfx/canvas.h" |
36 #include "ui/gfx/path.h" | 36 #include "ui/gfx/path.h" |
37 #include "ui/gfx/point.h" | 37 #include "ui/gfx/point.h" |
38 #include "ui/gfx/skia_util.h" | 38 #include "ui/gfx/skia_util.h" |
39 #include "ui/views/background.h" | 39 #include "ui/views/background.h" |
40 #include "ui/views/border.h" | 40 #include "ui/views/border.h" |
41 #include "ui/views/bubble/bubble_border.h" | 41 #include "ui/views/bubble/bubble_border.h" |
42 #include "ui/views/bubble/bubble_frame_view.h" | 42 #include "ui/views/bubble/bubble_frame_view.h" |
43 #include "ui/views/controls/button/blue_button.h" | 43 #include "ui/views/controls/button/blue_button.h" |
44 #include "ui/views/controls/button/checkbox.h" | 44 #include "ui/views/controls/button/checkbox.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 AutofillDialogViewDelegate* delegate_; | 413 AutofillDialogViewDelegate* delegate_; |
414 | 414 |
415 // The checkbox associated with this notification, or NULL if there is none. | 415 // The checkbox associated with this notification, or NULL if there is none. |
416 views::Checkbox* checkbox_; | 416 views::Checkbox* checkbox_; |
417 | 417 |
418 DISALLOW_COPY_AND_ASSIGN(NotificationView); | 418 DISALLOW_COPY_AND_ASSIGN(NotificationView); |
419 }; | 419 }; |
420 | 420 |
421 // A view that displays a loading message with some dancing dots. | 421 // A view that displays a loading message with some dancing dots. |
422 class LoadingAnimationView : public views::View, | 422 class LoadingAnimationView : public views::View, |
423 public ui::AnimationDelegate { | 423 public gfx::AnimationDelegate { |
424 public: | 424 public: |
425 explicit LoadingAnimationView(const base::string16& text) : | 425 explicit LoadingAnimationView(const base::string16& text) : |
426 container_(new views::View()), | 426 container_(new views::View()), |
427 animation_(this) { | 427 animation_(this) { |
428 | 428 |
429 set_background(views::Background::CreateSolidBackground( | 429 set_background(views::Background::CreateSolidBackground( |
430 GetNativeTheme()->GetSystemColor( | 430 GetNativeTheme()->GetSystemColor( |
431 ui::NativeTheme::kColorId_DialogBackground))); | 431 ui::NativeTheme::kColorId_DialogBackground))); |
432 | 432 |
433 AddChildView(container_); | 433 AddChildView(container_); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 container_size.height()); | 470 container_size.height()); |
471 container_->SetBoundsRect(container_bounds); | 471 container_->SetBoundsRect(container_bounds); |
472 container_->Layout(); | 472 container_->Layout(); |
473 | 473 |
474 for (size_t i = 0; i < 3; ++i) { | 474 for (size_t i = 0; i < 3; ++i) { |
475 views::View* dot = container_->child_at(i + 1); | 475 views::View* dot = container_->child_at(i + 1); |
476 dot->SetY(dot->y() + animation_.GetCurrentValueForDot(i) * 10.0); | 476 dot->SetY(dot->y() + animation_.GetCurrentValueForDot(i) * 10.0); |
477 } | 477 } |
478 } | 478 } |
479 | 479 |
480 // ui::AnimationDelegate implementation. | 480 // gfx::AnimationDelegate implementation. |
481 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE { | 481 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE { |
482 DCHECK_EQ(animation, &animation_); | 482 DCHECK_EQ(animation, &animation_); |
483 Layout(); | 483 Layout(); |
484 } | 484 } |
485 | 485 |
486 private: | 486 private: |
487 // Contains the "Loading" label and the dots. | 487 // Contains the "Loading" label and the dots. |
488 views::View* container_; | 488 views::View* container_; |
489 | 489 |
490 LoadingAnimation animation_; | 490 LoadingAnimation animation_; |
491 | 491 |
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2342 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) | 2342 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
2343 : section(section), | 2343 : section(section), |
2344 container(NULL), | 2344 container(NULL), |
2345 manual_input(NULL), | 2345 manual_input(NULL), |
2346 suggested_info(NULL), | 2346 suggested_info(NULL), |
2347 suggested_button(NULL) {} | 2347 suggested_button(NULL) {} |
2348 | 2348 |
2349 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} | 2349 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} |
2350 | 2350 |
2351 } // namespace autofill | 2351 } // namespace autofill |
OLD | NEW |