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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 56 |
57 // No animation for popup appearance (too distracting). | 57 // No animation for popup appearance (too distracting). |
58 widget->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE); | 58 widget->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE); |
59 | 59 |
60 show_time_ = base::Time::Now(); | 60 show_time_ = base::Time::Now(); |
61 } | 61 } |
62 | 62 |
63 SetBorder(views::Border::CreateSolidBorder(kPopupBorderThickness, | 63 SetBorder(views::CreateSolidBorder(kPopupBorderThickness, kBorderColor)); |
64 kBorderColor)); | |
65 | 64 |
66 DoUpdateBoundsAndRedrawPopup(); | 65 DoUpdateBoundsAndRedrawPopup(); |
67 GetWidget()->Show(); | 66 GetWidget()->Show(); |
68 | 67 |
69 // Showing the widget can change native focus (which would result in an | 68 // Showing the widget can change native focus (which would result in an |
70 // immediate hiding of the popup). Only start observing after shown. | 69 // immediate hiding of the popup). Only start observing after shown. |
71 if (initialize_widget) | 70 if (initialize_widget) |
72 views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this); | 71 views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this); |
73 } | 72 } |
74 | 73 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 void AutofillPopupBaseView::HideController() { | 230 void AutofillPopupBaseView::HideController() { |
232 if (delegate_) | 231 if (delegate_) |
233 delegate_->Hide(); | 232 delegate_->Hide(); |
234 } | 233 } |
235 | 234 |
236 gfx::NativeView AutofillPopupBaseView::container_view() { | 235 gfx::NativeView AutofillPopupBaseView::container_view() { |
237 return delegate_->container_view(); | 236 return delegate_->container_view(); |
238 } | 237 } |
239 | 238 |
240 } // namespace autofill | 239 } // namespace autofill |
OLD | NEW |