| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/input_method_engine.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_engine.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const std::string& engine_id, | 99 const std::string& engine_id, |
| 100 int candidate_id, | 100 int candidate_id, |
| 101 InputMethodEngineBase::MouseButtonEvent button) override {} | 101 InputMethodEngineBase::MouseButtonEvent button) override {} |
| 102 void OnMenuItemActivated(const std::string& engine_id, | 102 void OnMenuItemActivated(const std::string& engine_id, |
| 103 const std::string& menu_id) override {} | 103 const std::string& menu_id) override {} |
| 104 void OnSurroundingTextChanged(const std::string& engine_id, | 104 void OnSurroundingTextChanged(const std::string& engine_id, |
| 105 const std::string& text, | 105 const std::string& text, |
| 106 int cursor_pos, | 106 int cursor_pos, |
| 107 int anchor_pos, | 107 int anchor_pos, |
| 108 int offset) override {} | 108 int offset) override {} |
| 109 void OnRequestEngineSwitch() override {} |
| 109 void OnCompositionBoundsChanged( | 110 void OnCompositionBoundsChanged( |
| 110 const std::vector<gfx::Rect>& bounds) override { | 111 const std::vector<gfx::Rect>& bounds) override { |
| 111 calls_bitmap_ |= ONCOMPOSITIONBOUNDSCHANGED; | 112 calls_bitmap_ |= ONCOMPOSITIONBOUNDSCHANGED; |
| 112 } | 113 } |
| 113 void OnReset(const std::string& engine_id) override {} | 114 void OnReset(const std::string& engine_id) override {} |
| 114 | 115 |
| 115 unsigned char GetCallsBitmapAndReset() { | 116 unsigned char GetCallsBitmapAndReset() { |
| 116 unsigned char ret = calls_bitmap_; | 117 unsigned char ret = calls_bitmap_; |
| 117 calls_bitmap_ = NONE; | 118 calls_bitmap_ = NONE; |
| 118 return ret; | 119 return ret; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 CreateEngine(true); | 272 CreateEngine(true); |
| 272 // Enable/disable with focus. | 273 // Enable/disable with focus. |
| 273 std::vector<gfx::Rect> rects; | 274 std::vector<gfx::Rect> rects; |
| 274 rects.push_back(gfx::Rect()); | 275 rects.push_back(gfx::Rect()); |
| 275 engine_->SetCompositionBounds(rects); | 276 engine_->SetCompositionBounds(rects); |
| 276 EXPECT_EQ(ONCOMPOSITIONBOUNDSCHANGED, observer_->GetCallsBitmapAndReset()); | 277 EXPECT_EQ(ONCOMPOSITIONBOUNDSCHANGED, observer_->GetCallsBitmapAndReset()); |
| 277 } | 278 } |
| 278 | 279 |
| 279 } // namespace input_method | 280 } // namespace input_method |
| 280 } // namespace chromeos | 281 } // namespace chromeos |
| OLD | NEW |