diff options
author | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 08:05:21 +0000 |
---|---|---|
committer | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 08:05:21 +0000 |
commit | d37d45ab0d5ef606b0f44d9591bfdb457d7de733 (patch) | |
tree | dc9a300594199fc1f940d2d218119e1ffbd173d8 /chrome | |
parent | 490937ae6ee14316801453a05cc2aafc159f440e (diff) | |
download | chromium_src-d37d45ab0d5ef606b0f44d9591bfdb457d7de733.zip chromium_src-d37d45ab0d5ef606b0f44d9591bfdb457d7de733.tar.gz chromium_src-d37d45ab0d5ef606b0f44d9591bfdb457d7de733.tar.bz2 |
Exit cleanly from the candidate_window if it can't connect to ibus.
BUG=chromium-os:6002
TEST=None
Review URL: http://codereview.chromium.org/3223012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58146 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chromeos/input_method/candidate_window.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/input_method/candidate_window.cc b/chrome/browser/chromeos/input_method/candidate_window.cc index a6fd344..229c5f0 100644 --- a/chrome/browser/chromeos/input_method/candidate_window.cc +++ b/chrome/browser/chromeos/input_method/candidate_window.cc @@ -308,7 +308,7 @@ class CandidateWindowController : public CandidateWindowView::Observer { public: CandidateWindowController(); virtual ~CandidateWindowController(); - void Init(); + bool Init(); // Returns the work area of the monitor nearest the candidate window. gfx::Rect GetMonitorWorkAreaNearestWindow(); @@ -858,7 +858,7 @@ int CandidateWindowView::GetHorizontalOffset() { } -void CandidateWindowController::Init() { +bool CandidateWindowController::Init() { // Initialize the input method UI status connection. InputMethodUiStatusMonitorFunctions functions; functions.hide_auxiliary_text = @@ -872,11 +872,15 @@ void CandidateWindowController::Init() { functions.update_lookup_table = &CandidateWindowController::OnUpdateLookupTable; ui_status_connection_ = MonitorInputMethodUiStatus(functions, this); - CHECK(ui_status_connection_) - << "MonitorInputMethodUiStatus() failed."; + if (!ui_status_connection_) { + LOG(ERROR) << "MonitorInputMethodUiStatus() failed."; + return false; + } // Create the candidate window view. CreateView(); + + return true; } void CandidateWindowController::CreateView() { @@ -1083,7 +1087,9 @@ int main(int argc, char** argv) { // Create the candidate window controller. chromeos::CandidateWindowController controller; - controller.Init(); + if (!controller.Init()) { + return 1; + } // Start the main loop. views::AcceleratorHandler accelerator_handler; |