OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This file is for non-chromeos (win & linux) functions, such as | 5 // This file is for non-chromeos (win & linux) functions, such as |
6 // chrome.input.ime.activate, chrome.input.ime.createWindow and | 6 // chrome.input.ime.activate, chrome.input.ime.createWindow and |
7 // chrome.input.ime.onSelectionChanged. | 7 // chrome.input.ime.onSelectionChanged. |
8 // TODO(azurewei): May refactor the code structure by using delegate or | 8 // TODO(azurewei): May refactor the code structure by using delegate or |
9 // redesign the API to remove this platform-specific file in the future. | 9 // redesign the API to remove this platform-specific file in the future. |
10 | 10 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 bounds.set_width(options.bounds->width); | 217 bounds.set_width(options.bounds->width); |
218 bounds.set_height(options.bounds->height); | 218 bounds.set_height(options.bounds->height); |
219 } | 219 } |
220 | 220 |
221 InputMethodEngine* engine = | 221 InputMethodEngine* engine = |
222 GetActiveEngine(browser_context(), extension_id()); | 222 GetActiveEngine(browser_context(), extension_id()); |
223 if (!engine) | 223 if (!engine) |
224 return RespondNow(Error(kErrorNoActiveEngine)); | 224 return RespondNow(Error(kErrorNoActiveEngine)); |
225 | 225 |
226 int frame_id = engine->CreateImeWindow( | 226 int frame_id = engine->CreateImeWindow( |
227 extension(), options.url.get() ? *options.url : url::kAboutBlankURL, | 227 extension(), render_frame_host(), |
| 228 options.url.get() ? *options.url : url::kAboutBlankURL, |
228 options.window_type == input_ime::WINDOW_TYPE_FOLLOWCURSOR | 229 options.window_type == input_ime::WINDOW_TYPE_FOLLOWCURSOR |
229 ? ui::ImeWindow::FOLLOW_CURSOR | 230 ? ui::ImeWindow::FOLLOW_CURSOR |
230 : ui::ImeWindow::NORMAL, | 231 : ui::ImeWindow::NORMAL, |
231 bounds, &error_); | 232 bounds, &error_); |
232 if (!frame_id) | 233 if (!frame_id) |
233 return RespondNow(Error(error_)); | 234 return RespondNow(Error(error_)); |
234 | 235 |
235 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); | 236 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); |
236 result->Set("frameId", new base::FundamentalValue(frame_id)); | 237 result->Set("frameId", new base::FundamentalValue(frame_id)); |
237 | 238 |
238 return RespondNow(OneArgument(std::move(result))); | 239 return RespondNow(OneArgument(std::move(result))); |
239 } | 240 } |
240 | 241 |
241 } // namespace extensions | 242 } // namespace extensions |
OLD | NEW |