| 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/autofill/popup_controller_common.h" | 5 #include "chrome/browser/ui/autofill/popup_controller_common.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 key_press_event_target_ == web_contents_->GetRenderViewHost()) { | 48 key_press_event_target_ == web_contents_->GetRenderViewHost()) { |
| 49 web_contents_->GetRenderViewHost() | 49 web_contents_->GetRenderViewHost() |
| 50 ->GetWidget() | 50 ->GetWidget() |
| 51 ->RemoveKeyPressEventCallback(key_press_event_callback_); | 51 ->RemoveKeyPressEventCallback(key_press_event_callback_); |
| 52 } | 52 } |
| 53 key_press_event_target_ = NULL; | 53 key_press_event_target_ = NULL; |
| 54 } | 54 } |
| 55 | 55 |
| 56 gfx::Display PopupControllerCommon::GetDisplayNearestPoint( | 56 gfx::Display PopupControllerCommon::GetDisplayNearestPoint( |
| 57 const gfx::Point& point) const { | 57 const gfx::Point& point) const { |
| 58 return gfx::Screen::GetScreenFor(container_view_)->GetDisplayNearestPoint( | 58 return gfx::Screen::GetScreen()->GetDisplayNearestPoint(point); |
| 59 point); | |
| 60 } | 59 } |
| 61 | 60 |
| 62 const gfx::Rect PopupControllerCommon::RoundedElementBounds() const { | 61 const gfx::Rect PopupControllerCommon::RoundedElementBounds() const { |
| 63 return gfx::ToEnclosingRect(element_bounds_); | 62 return gfx::ToEnclosingRect(element_bounds_); |
| 64 } | 63 } |
| 65 | 64 |
| 66 std::pair<int, int> PopupControllerCommon::CalculatePopupXAndWidth( | 65 std::pair<int, int> PopupControllerCommon::CalculatePopupXAndWidth( |
| 67 const gfx::Display& left_display, | 66 const gfx::Display& left_display, |
| 68 const gfx::Display& right_display, | 67 const gfx::Display& right_display, |
| 69 int popup_required_width) const { | 68 int popup_required_width) const { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 bottom_right_display, | 163 bottom_right_display, |
| 165 desired_height); | 164 desired_height); |
| 166 | 165 |
| 167 return gfx::Rect(popup_x_and_width.first, | 166 return gfx::Rect(popup_x_and_width.first, |
| 168 popup_y_and_height.first, | 167 popup_y_and_height.first, |
| 169 popup_x_and_width.second, | 168 popup_x_and_width.second, |
| 170 popup_y_and_height.second); | 169 popup_y_and_height.second); |
| 171 } | 170 } |
| 172 | 171 |
| 173 } // namespace autofill | 172 } // namespace autofill |
| OLD | NEW |