OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 28 matching lines...) Expand all Loading... |
39 const SkColor kDefaultBackgroundColor = SkColorSetRGB(0xff, 0xff, 0xff); | 39 const SkColor kDefaultBackgroundColor = SkColorSetRGB(0xff, 0xff, 0xff); |
40 const SkColor kSelectedRowFrameColor = SkColorSetRGB(0x7f, 0xac, 0xdd); | 40 const SkColor kSelectedRowFrameColor = SkColorSetRGB(0x7f, 0xac, 0xdd); |
41 const SkColor kFooterTopColor = SkColorSetRGB(0xff, 0xff, 0xff); | 41 const SkColor kFooterTopColor = SkColorSetRGB(0xff, 0xff, 0xff); |
42 const SkColor kFooterBottomColor = SkColorSetRGB(0xee, 0xee, 0xee); | 42 const SkColor kFooterBottomColor = SkColorSetRGB(0xee, 0xee, 0xee); |
43 const SkColor kShortcutColor = SkColorSetRGB(0x61, 0x61, 0x61); | 43 const SkColor kShortcutColor = SkColorSetRGB(0x61, 0x61, 0x61); |
44 const SkColor kDisabledShortcutColor = SkColorSetRGB(0xcc, 0xcc, 0xcc); | 44 const SkColor kDisabledShortcutColor = SkColorSetRGB(0xcc, 0xcc, 0xcc); |
45 const SkColor kAnnotationColor = SkColorSetRGB(0x88, 0x88, 0x88); | 45 const SkColor kAnnotationColor = SkColorSetRGB(0x88, 0x88, 0x88); |
46 | 46 |
47 // We'll use a bigger font size, so Chinese characters are more readable | 47 // We'll use a bigger font size, so Chinese characters are more readable |
48 // in the candidate window. | 48 // in the candidate window. |
49 const int kFontSizeDelta = 2; // Two size bigger. | 49 #if defined(CROS_FONTS_USING_BCI) |
| 50 const int kFontSizeDelta = 1; |
| 51 #else |
| 52 const int kFontSizeDelta = 2; |
| 53 #endif |
50 | 54 |
51 // The minimum width of candidate labels in the vertical candidate | 55 // The minimum width of candidate labels in the vertical candidate |
52 // window. We use this value to prevent the candidate window from being | 56 // window. We use this value to prevent the candidate window from being |
53 // too narrow when all candidates are short. | 57 // too narrow when all candidates are short. |
54 const int kMinCandidateLabelWidth = 100; | 58 const int kMinCandidateLabelWidth = 100; |
55 // The maximum width of candidate labels in the vertical candidate | 59 // The maximum width of candidate labels in the vertical candidate |
56 // window. We use this value to prevent the candidate window from being | 60 // window. We use this value to prevent the candidate window from being |
57 // too wide when one of candidates are long. | 61 // too wide when one of candidates are long. |
58 const int kMaxCandidateLabelWidth = 500; | 62 const int kMaxCandidateLabelWidth = 500; |
59 | 63 |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 | 1261 |
1258 void CandidateWindowController::Impl::OnConnectionChange( | 1262 void CandidateWindowController::Impl::OnConnectionChange( |
1259 void* input_method_library, | 1263 void* input_method_library, |
1260 bool connected) { | 1264 bool connected) { |
1261 if (!connected) { | 1265 if (!connected) { |
1262 MessageLoopForUI::current()->PostTask(FROM_HERE, | 1266 MessageLoopForUI::current()->PostTask(FROM_HERE, |
1263 new MessageLoop::QuitTask()); | 1267 new MessageLoop::QuitTask()); |
1264 } | 1268 } |
1265 } | 1269 } |
1266 | 1270 |
1267 CandidateWindowController::CandidateWindowController() : | 1271 CandidateWindowController::CandidateWindowController() |
1268 impl_(new CandidateWindowController::Impl) { | 1272 : impl_(new CandidateWindowController::Impl) { |
1269 } | 1273 } |
1270 | 1274 |
1271 CandidateWindowController::~CandidateWindowController() { | 1275 CandidateWindowController::~CandidateWindowController() { |
1272 delete impl_; | 1276 delete impl_; |
1273 } | 1277 } |
1274 | 1278 |
1275 bool CandidateWindowController::Init() { | 1279 bool CandidateWindowController::Init() { |
1276 return impl_->Init(); | 1280 return impl_->Init(); |
1277 } | 1281 } |
1278 | 1282 |
1279 } // namespace chromeos | 1283 } // namespace chromeos |
OLD | NEW |