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_controller_impl.
h" | 5 #include "chrome/browser/chromeos/input_method/candidate_window_controller_impl.
h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 } | 37 } |
38 | 38 |
39 // Returns pointer of IBusPanelService. This function returns NULL if it is not | 39 // Returns pointer of IBusPanelService. This function returns NULL if it is not |
40 // ready. | 40 // ready. |
41 IBusPanelService* GetIBusPanelService() { | 41 IBusPanelService* GetIBusPanelService() { |
42 return DBusThreadManager::Get()->GetIBusPanelService(); | 42 return DBusThreadManager::Get()->GetIBusPanelService(); |
43 } | 43 } |
44 } // namespace | 44 } // namespace |
45 | 45 |
46 bool CandidateWindowControllerImpl::Init() { | 46 bool CandidateWindowControllerImpl::Init() { |
| 47 if (DBusThreadManager::Get()->GetIBusPanelService()) { |
| 48 DBusThreadManager::Get()->GetIBusPanelService()-> |
| 49 SetUpCandidateWindowHandler(this); |
| 50 } |
47 IBusDaemonController::GetInstance()->AddObserver(this); | 51 IBusDaemonController::GetInstance()->AddObserver(this); |
48 // Create the candidate window view. | 52 // Create the candidate window view. |
49 CreateView(); | 53 CreateView(); |
50 return true; | 54 return true; |
51 } | 55 } |
52 | 56 |
53 void CandidateWindowControllerImpl::Shutdown() { | 57 void CandidateWindowControllerImpl::Shutdown() { |
54 IBusDaemonController::GetInstance()->RemoveObserver(this); | 58 IBusDaemonController::GetInstance()->RemoveObserver(this); |
55 } | 59 } |
56 | 60 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 353 |
350 if (candidate_window_rect.y() + infolist_window_size.height() > | 354 if (candidate_window_rect.y() + infolist_window_size.height() > |
351 screen_rect.bottom()) | 355 screen_rect.bottom()) |
352 result.set_y(screen_rect.bottom() - infolist_window_size.height()); | 356 result.set_y(screen_rect.bottom() - infolist_window_size.height()); |
353 | 357 |
354 return result; | 358 return result; |
355 } | 359 } |
356 | 360 |
357 } // namespace input_method | 361 } // namespace input_method |
358 } // namespace chromeos | 362 } // namespace chromeos |
OLD | NEW |