Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.cc

Issue 1756853002: Correctly sets the security origin for the IME window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed tests. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/ime/ime_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ime/ime_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698