| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/link_disambiguation/link_disambiguation_popup.
h" | 5 #include "chrome/browser/ui/views/link_disambiguation/link_disambiguation_popup.
h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "ui/aura/client/screen_position_client.h" | 8 #include "ui/aura/client/screen_position_client.h" |
| 9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
| 10 #include "ui/events/event_processor.h" | 10 #include "ui/events/event_processor.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 gfx::Point target_screen(target_rect.x() + (target_rect.width() / 2), | 178 gfx::Point target_screen(target_rect.x() + (target_rect.width() / 2), |
| 179 target_rect.y() + (target_rect.height() / 2)); | 179 target_rect.y() + (target_rect.height() / 2)); |
| 180 if (screen_position_client) | 180 if (screen_position_client) |
| 181 screen_position_client->ConvertPointToScreen(content_, &target_screen); | 181 screen_position_client->ConvertPointToScreen(content_, &target_screen); |
| 182 gfx::Rect window_bounds( | 182 gfx::Rect window_bounds( |
| 183 target_screen.x() - (zoomed_bitmap.width() / 2), | 183 target_screen.x() - (zoomed_bitmap.width() / 2), |
| 184 target_screen.y() - (zoomed_bitmap.height() / 2), | 184 target_screen.y() - (zoomed_bitmap.height() / 2), |
| 185 zoomed_bitmap.width(), | 185 zoomed_bitmap.width(), |
| 186 zoomed_bitmap.height()); | 186 zoomed_bitmap.height()); |
| 187 const gfx::Display display = | 187 const gfx::Display display = |
| 188 gfx::Screen::GetScreenFor(content)->GetDisplayNearestWindow(content); | 188 gfx::Screen::GetScreen()->GetDisplayNearestWindow(content); |
| 189 window_bounds.AdjustToFit(display.work_area()); | 189 window_bounds.AdjustToFit(display.work_area()); |
| 190 view_->GetWidget()->SetBounds(window_bounds); | 190 view_->GetWidget()->SetBounds(window_bounds); |
| 191 view_->GetWidget()->Show(); | 191 view_->GetWidget()->Show(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void LinkDisambiguationPopup::Close() { | 194 void LinkDisambiguationPopup::Close() { |
| 195 if (view_) { | 195 if (view_) { |
| 196 view_->Close(); | 196 view_->Close(); |
| 197 view_ = NULL; | 197 view_ = NULL; |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 void LinkDisambiguationPopup::InvalidateBubbleView() { | 201 void LinkDisambiguationPopup::InvalidateBubbleView() { |
| 202 view_ = NULL; | 202 view_ = NULL; |
| 203 } | 203 } |
| OLD | NEW |