| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/input_method/candidate_window.h" | 5 #include "chrome/browser/chromeos/input_method/candidate_window.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 // To avoid lookup-table overlapping, uses maximum y-position of mozc specific | 1209 // To avoid lookup-table overlapping, uses maximum y-position of mozc specific |
| 1210 // location and cursor location, because mozc-engine does not consider about | 1210 // location and cursor location, because mozc-engine does not consider about |
| 1211 // multi-line composition. | 1211 // multi-line composition. |
| 1212 const int y = should_show_at_composition_head_? | 1212 const int y = should_show_at_composition_head_? |
| 1213 std::max(composition_head_location_.y(), cursor_location_.y()) : | 1213 std::max(composition_head_location_.y(), cursor_location_.y()) : |
| 1214 cursor_location_.y(); | 1214 cursor_location_.y(); |
| 1215 const int height = cursor_location_.height(); | 1215 const int height = cursor_location_.height(); |
| 1216 const int horizontal_offset = GetHorizontalOffset(); | 1216 const int horizontal_offset = GetHorizontalOffset(); |
| 1217 | 1217 |
| 1218 gfx::Rect old_bounds = parent_frame_->GetClientAreaBoundsInScreen(); | 1218 gfx::Rect old_bounds = parent_frame_->GetClientAreaBoundsInScreen(); |
| 1219 gfx::Rect screen_bounds = gfx::Screen::GetDisplayNearestWindow( | 1219 gfx::Rect screen_bounds = |
| 1220 parent_frame_->GetNativeView()).work_area(); | 1220 gfx::Screen::GetDisplayMatching(cursor_location_).work_area(); |
| 1221 // The size. | 1221 // The size. |
| 1222 gfx::Rect frame_bounds = old_bounds; | 1222 gfx::Rect frame_bounds = old_bounds; |
| 1223 frame_bounds.set_size(GetPreferredSize()); | 1223 frame_bounds.set_size(GetPreferredSize()); |
| 1224 | 1224 |
| 1225 // The default position. | 1225 // The default position. |
| 1226 frame_bounds.set_x(x + horizontal_offset); | 1226 frame_bounds.set_x(x + horizontal_offset); |
| 1227 frame_bounds.set_y(y + height); | 1227 frame_bounds.set_y(y + height); |
| 1228 | 1228 |
| 1229 // Handle overflow at the left and the top. | 1229 // Handle overflow at the left and the top. |
| 1230 frame_bounds.set_x(std::max(frame_bounds.x(), screen_bounds.x())); | 1230 frame_bounds.set_x(std::max(frame_bounds.x(), screen_bounds.x())); |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1769 } | 1769 } |
| 1770 | 1770 |
| 1771 // static | 1771 // static |
| 1772 CandidateWindowController* | 1772 CandidateWindowController* |
| 1773 CandidateWindowController::CreateCandidateWindowController() { | 1773 CandidateWindowController::CreateCandidateWindowController() { |
| 1774 return new CandidateWindowControllerImpl; | 1774 return new CandidateWindowControllerImpl; |
| 1775 } | 1775 } |
| 1776 | 1776 |
| 1777 } // namespace input_method | 1777 } // namespace input_method |
| 1778 } // namespace chromeos | 1778 } // namespace chromeos |
| OLD | NEW |