Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/chromeos/input_method/candidate_window.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.cc ('k') | chrome/browser/chromeos/login/helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 // To avoid lookup-table overlapping, uses maximum y-position of mozc specific 1198 // To avoid lookup-table overlapping, uses maximum y-position of mozc specific
1199 // location and cursor location, because mozc-engine does not consider about 1199 // location and cursor location, because mozc-engine does not consider about
1200 // multi-line composition. 1200 // multi-line composition.
1201 const int y = is_suggestion_window_location_available_ ? 1201 const int y = is_suggestion_window_location_available_ ?
1202 std::max(suggestion_window_location_.y(), cursor_location_.y()) : 1202 std::max(suggestion_window_location_.y(), cursor_location_.y()) :
1203 cursor_location_.y(); 1203 cursor_location_.y();
1204 const int height = cursor_location_.height(); 1204 const int height = cursor_location_.height();
1205 const int horizontal_offset = GetHorizontalOffset(); 1205 const int horizontal_offset = GetHorizontalOffset();
1206 1206
1207 gfx::Rect old_bounds = parent_frame_->GetClientAreaScreenBounds(); 1207 gfx::Rect old_bounds = parent_frame_->GetClientAreaScreenBounds();
1208 gfx::Rect screen_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( 1208 gfx::Rect screen_bounds = gfx::Screen::GetMonitorNearestWindow(
1209 parent_frame_->GetNativeView()); 1209 parent_frame_->GetNativeView()).work_area();
1210 // The size. 1210 // The size.
1211 gfx::Rect frame_bounds = old_bounds; 1211 gfx::Rect frame_bounds = old_bounds;
1212 frame_bounds.set_size(GetPreferredSize()); 1212 frame_bounds.set_size(GetPreferredSize());
1213 1213
1214 // The default position. 1214 // The default position.
1215 frame_bounds.set_x(x + horizontal_offset); 1215 frame_bounds.set_x(x + horizontal_offset);
1216 frame_bounds.set_y(y + height); 1216 frame_bounds.set_y(y + height);
1217 1217
1218 // Handle overflow at the left and the top. 1218 // Handle overflow at the left and the top.
1219 frame_bounds.set_x(std::max(frame_bounds.x(), screen_bounds.x())); 1219 frame_bounds.set_x(std::max(frame_bounds.x(), screen_bounds.x()));
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 layout->StartRow(0, 0); 1471 layout->StartRow(0, 0);
1472 layout->AddView(infolist_row); 1472 layout->AddView(infolist_row);
1473 } 1473 }
1474 1474
1475 layout->Layout(infolist_area_); 1475 layout->Layout(infolist_area_);
1476 } 1476 }
1477 1477
1478 void InfolistWindowView::ResizeAndMoveParentFrame() { 1478 void InfolistWindowView::ResizeAndMoveParentFrame() {
1479 int x, y; 1479 int x, y;
1480 gfx::Rect old_bounds = parent_frame_->GetClientAreaScreenBounds(); 1480 gfx::Rect old_bounds = parent_frame_->GetClientAreaScreenBounds();
1481 gfx::Rect screen_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( 1481 gfx::Rect screen_bounds = gfx::Screen::GetMonitorNearestWindow(
1482 parent_frame_->GetNativeView()); 1482 parent_frame_->GetNativeView()).work_area();
1483 // The size. 1483 // The size.
1484 gfx::Rect frame_bounds = old_bounds; 1484 gfx::Rect frame_bounds = old_bounds;
1485 frame_bounds.set_size(GetPreferredSize()); 1485 frame_bounds.set_size(GetPreferredSize());
1486 1486
1487 gfx::Rect candidatewindow_bounds; 1487 gfx::Rect candidatewindow_bounds;
1488 if (candidate_window_frame_ != NULL) { 1488 if (candidate_window_frame_ != NULL) {
1489 candidatewindow_bounds = 1489 candidatewindow_bounds =
1490 candidate_window_frame_->GetClientAreaScreenBounds(); 1490 candidate_window_frame_->GetClientAreaScreenBounds();
1491 } 1491 }
1492 1492
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 } 1711 }
1712 1712
1713 // static 1713 // static
1714 CandidateWindowController* 1714 CandidateWindowController*
1715 CandidateWindowController::CreateCandidateWindowController() { 1715 CandidateWindowController::CreateCandidateWindowController() {
1716 return new CandidateWindowControllerImpl; 1716 return new CandidateWindowControllerImpl;
1717 } 1717 }
1718 1718
1719 } // namespace input_method 1719 } // namespace input_method
1720 } // namespace chromeos 1720 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.cc ('k') | chrome/browser/chromeos/login/helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698