Chromium Code Reviews| 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" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chrome/browser/ui/autofill/popup_constants.h" | 12 #include "chrome/browser/ui/autofill/popup_constants.h" |
| 13 #include "ui/native_theme/native_theme.h" | |
| 13 #include "ui/views/border.h" | 14 #include "ui/views/border.h" |
| 14 #include "ui/views/focus/focus_manager.h" | 15 #include "ui/views/focus/focus_manager.h" |
| 15 #include "ui/views/widget/widget.h" | 16 #include "ui/views/widget/widget.h" |
| 16 | 17 |
| 17 namespace autofill { | 18 namespace autofill { |
| 18 | 19 |
| 19 AutofillPopupBaseView::AutofillPopupBaseView( | 20 AutofillPopupBaseView::AutofillPopupBaseView( |
| 20 AutofillPopupViewDelegate* delegate, | 21 AutofillPopupViewDelegate* delegate, |
| 21 views::Widget* parent_widget) | 22 views::Widget* parent_widget) |
| 22 : delegate_(delegate), | 23 : delegate_(delegate), |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 53 params.delegate = this; | 54 params.delegate = this; |
| 54 params.parent = parent_widget_->GetNativeView(); | 55 params.parent = parent_widget_->GetNativeView(); |
| 55 widget->Init(params); | 56 widget->Init(params); |
| 56 | 57 |
| 57 // No animation for popup appearance (too distracting). | 58 // No animation for popup appearance (too distracting). |
| 58 widget->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE); | 59 widget->SetVisibilityAnimationTransition(views::Widget::ANIMATE_HIDE); |
| 59 | 60 |
| 60 show_time_ = base::Time::Now(); | 61 show_time_ = base::Time::Now(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 SetBorder(views::CreateSolidBorder(kPopupBorderThickness, kBorderColor)); | 64 SetBorder(views::CreateSolidBorder( |
| 65 kPopupBorderThickness, | |
| 66 GetNativeTheme()->GetSystemColor( | |
| 67 ui::NativeTheme::kColorId_UnfocusedBorderColor))); | |
|
Mathieu
2016/12/20 20:36:40
Is there a possibility to have a code path where w
jiahuiguo
2017/01/03 19:37:52
Done. Added in https://crbug.com/676164
Mathieu
2017/01/04 13:51:48
Please reference here:
// TODO(crbug.com/676164):
jiahuiguo
2017/01/05 19:21:20
Done.
| |
| 64 | 68 |
| 65 DoUpdateBoundsAndRedrawPopup(); | 69 DoUpdateBoundsAndRedrawPopup(); |
| 66 GetWidget()->Show(); | 70 GetWidget()->Show(); |
| 67 | 71 |
| 68 // Showing the widget can change native focus (which would result in an | 72 // Showing the widget can change native focus (which would result in an |
| 69 // immediate hiding of the popup). Only start observing after shown. | 73 // immediate hiding of the popup). Only start observing after shown. |
| 70 if (initialize_widget) | 74 if (initialize_widget) |
| 71 views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this); | 75 views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this); |
| 72 } | 76 } |
| 73 | 77 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 void AutofillPopupBaseView::HideController() { | 234 void AutofillPopupBaseView::HideController() { |
| 231 if (delegate_) | 235 if (delegate_) |
| 232 delegate_->Hide(); | 236 delegate_->Hide(); |
| 233 } | 237 } |
| 234 | 238 |
| 235 gfx::NativeView AutofillPopupBaseView::container_view() { | 239 gfx::NativeView AutofillPopupBaseView::container_view() { |
| 236 return delegate_->container_view(); | 240 return delegate_->container_view(); |
| 237 } | 241 } |
| 238 | 242 |
| 239 } // namespace autofill | 243 } // namespace autofill |
| OLD | NEW |