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 composition_head_location_.x() : cursor_location_.x(); | 1209 composition_head_location_.x() : cursor_location_.x(); |
1210 // To avoid lookup-table overlapping, uses maximum y-position of mozc specific | 1210 // To avoid lookup-table overlapping, uses maximum y-position of mozc specific |
1211 // location and cursor location, because mozc-engine does not consider about | 1211 // location and cursor location, because mozc-engine does not consider about |
1212 // multi-line composition. | 1212 // multi-line composition. |
1213 const int y = should_show_at_composition_head_? | 1213 const int y = should_show_at_composition_head_? |
1214 std::max(composition_head_location_.y(), cursor_location_.y()) : | 1214 std::max(composition_head_location_.y(), cursor_location_.y()) : |
1215 cursor_location_.y(); | 1215 cursor_location_.y(); |
1216 const int height = cursor_location_.height(); | 1216 const int height = cursor_location_.height(); |
1217 const int horizontal_offset = GetHorizontalOffset(); | 1217 const int horizontal_offset = GetHorizontalOffset(); |
1218 | 1218 |
1219 gfx::Rect old_bounds = parent_frame_->GetClientAreaScreenBounds(); | 1219 gfx::Rect old_bounds = parent_frame_->GetClientAreaBoundsInScreen(); |
1220 gfx::Rect screen_bounds = gfx::Screen::GetDisplayNearestWindow( | 1220 gfx::Rect screen_bounds = gfx::Screen::GetDisplayNearestWindow( |
1221 parent_frame_->GetNativeView()).work_area(); | 1221 parent_frame_->GetNativeView()).work_area(); |
1222 // The size. | 1222 // The size. |
1223 gfx::Rect frame_bounds = old_bounds; | 1223 gfx::Rect frame_bounds = old_bounds; |
1224 frame_bounds.set_size(GetPreferredSize()); | 1224 frame_bounds.set_size(GetPreferredSize()); |
1225 | 1225 |
1226 // The default position. | 1226 // The default position. |
1227 frame_bounds.set_x(x + horizontal_offset); | 1227 frame_bounds.set_x(x + horizontal_offset); |
1228 frame_bounds.set_y(y + height); | 1228 frame_bounds.set_y(y + height); |
1229 | 1229 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 (static_cast<int>(new_usages.focused_index()) == i)) { | 1504 (static_cast<int>(new_usages.focused_index()) == i)) { |
1505 infolist_row->Select(); | 1505 infolist_row->Select(); |
1506 } else { | 1506 } else { |
1507 infolist_row->Unselect(); | 1507 infolist_row->Unselect(); |
1508 } | 1508 } |
1509 } | 1509 } |
1510 } | 1510 } |
1511 | 1511 |
1512 void InfolistWindowView::ResizeAndMoveParentFrame() { | 1512 void InfolistWindowView::ResizeAndMoveParentFrame() { |
1513 int x, y; | 1513 int x, y; |
1514 gfx::Rect old_bounds = parent_frame_->GetClientAreaScreenBounds(); | 1514 gfx::Rect old_bounds = parent_frame_->GetClientAreaBoundsInScreen(); |
1515 gfx::Rect screen_bounds = gfx::Screen::GetDisplayNearestWindow( | 1515 gfx::Rect screen_bounds = gfx::Screen::GetDisplayNearestWindow( |
1516 parent_frame_->GetNativeView()).work_area(); | 1516 parent_frame_->GetNativeView()).work_area(); |
1517 // The size. | 1517 // The size. |
1518 gfx::Rect frame_bounds = old_bounds; | 1518 gfx::Rect frame_bounds = old_bounds; |
1519 gfx::Size size = GetPreferredSize(); | 1519 gfx::Size size = GetPreferredSize(); |
1520 frame_bounds.set_size(size); | 1520 frame_bounds.set_size(size); |
1521 | 1521 |
1522 gfx::Rect candidatewindow_bounds; | 1522 gfx::Rect candidatewindow_bounds; |
1523 if (candidate_window_frame_ != NULL) { | 1523 if (candidate_window_frame_ != NULL) { |
1524 candidatewindow_bounds = | 1524 candidatewindow_bounds = |
1525 candidate_window_frame_->GetClientAreaScreenBounds(); | 1525 candidate_window_frame_->GetClientAreaBoundsInScreen(); |
1526 } | 1526 } |
1527 | 1527 |
1528 if (screen_bounds.height() == 0 || screen_bounds.width() == 0) { | 1528 if (screen_bounds.height() == 0 || screen_bounds.width() == 0) { |
1529 x = candidatewindow_bounds.right(); | 1529 x = candidatewindow_bounds.right(); |
1530 y = candidatewindow_bounds.y(); | 1530 y = candidatewindow_bounds.y(); |
1531 } | 1531 } |
1532 if (candidatewindow_bounds.right() + frame_bounds.width() > | 1532 if (candidatewindow_bounds.right() + frame_bounds.width() > |
1533 screen_bounds.right()) { | 1533 screen_bounds.right()) { |
1534 x = candidatewindow_bounds.x() - frame_bounds.width(); | 1534 x = candidatewindow_bounds.x() - frame_bounds.width(); |
1535 } else { | 1535 } else { |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 } | 1770 } |
1771 | 1771 |
1772 // static | 1772 // static |
1773 CandidateWindowController* | 1773 CandidateWindowController* |
1774 CandidateWindowController::CreateCandidateWindowController() { | 1774 CandidateWindowController::CreateCandidateWindowController() { |
1775 return new CandidateWindowControllerImpl; | 1775 return new CandidateWindowControllerImpl; |
1776 } | 1776 } |
1777 | 1777 |
1778 } // namespace input_method | 1778 } // namespace input_method |
1779 } // namespace chromeos | 1779 } // namespace chromeos |
OLD | NEW |