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/views/autofill/autofill_popup_base_view.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_popup_base_view.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 this); | 46 this); |
47 | 47 |
48 // The widget is destroyed by the corresponding NativeWidget, so we use | 48 // The widget is destroyed by the corresponding NativeWidget, so we use |
49 // a weak pointer to hold the reference and don't have to worry about | 49 // a weak pointer to hold the reference and don't have to worry about |
50 // deletion. | 50 // deletion. |
51 views::Widget* widget = new views::Widget; | 51 views::Widget* widget = new views::Widget; |
52 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 52 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
53 params.delegate = this; | 53 params.delegate = this; |
54 params.parent = parent_widget_->GetNativeView(); | 54 params.parent = parent_widget_->GetNativeView(); |
55 widget->Init(params); | 55 widget->Init(params); |
56 widget->SetContentsView(this); | |
57 | 56 |
58 // No animation for popup appearance (too distracting). | 57 // No animation for popup appearance (too distracting). |
59 widget->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE); | 58 widget->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE); |
60 | 59 |
61 show_time_ = base::Time::Now(); | 60 show_time_ = base::Time::Now(); |
62 } | 61 } |
63 | 62 |
64 SetBorder(views::Border::CreateSolidBorder(kPopupBorderThickness, | 63 SetBorder(views::Border::CreateSolidBorder(kPopupBorderThickness, |
65 kBorderColor)); | 64 kBorderColor)); |
66 | 65 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 void AutofillPopupBaseView::HideController() { | 231 void AutofillPopupBaseView::HideController() { |
233 if (delegate_) | 232 if (delegate_) |
234 delegate_->Hide(); | 233 delegate_->Hide(); |
235 } | 234 } |
236 | 235 |
237 gfx::NativeView AutofillPopupBaseView::container_view() { | 236 gfx::NativeView AutofillPopupBaseView::container_view() { |
238 return delegate_->container_view(); | 237 return delegate_->container_view(); |
239 } | 238 } |
240 | 239 |
241 } // namespace autofill | 240 } // namespace autofill |
OLD | NEW |