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

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

Issue 10919236: Support multi display candidate window. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove unused inclusion Created 8 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698