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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc

Issue 599663003: Don't re-focus Settings window when opening IME options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ui/webui/options/chromeos/cros_language_options_handler .h" 5 #include "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler .h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 if (!ime) 235 if (!ime)
236 return; 236 return;
237 237
238 Browser* browser = chrome::FindBrowserWithWebContents( 238 Browser* browser = chrome::FindBrowserWithWebContents(
239 web_ui()->GetWebContents()); 239 web_ui()->GetWebContents());
240 content::OpenURLParams params(ime->options_page_url(), 240 content::OpenURLParams params(ime->options_page_url(),
241 content::Referrer(), 241 content::Referrer(),
242 SINGLETON_TAB, 242 SINGLETON_TAB,
243 ui::PAGE_TRANSITION_LINK, 243 ui::PAGE_TRANSITION_LINK,
244 false); 244 false);
245 browser->OpenURL(params); 245 browser->OpenURL(params);
stevenjb 2014/09/24 16:12:53 nit: It looks to me like this will allways be an e
michaelpg 2014/09/24 21:23:06 I think so but I'm not positive.
stevenjb 2014/09/25 15:49:41 Ah, yes, you're correct, I didn't notice this was
246 browser->window()->Show();
247 content::WebContents* web_contents =
248 browser->tab_strip_model()->GetActiveWebContents();
249 web_contents->GetDelegate()->ActivateContents(web_contents);
250 } 246 }
251 247
252 void CrosLanguageOptionsHandler::AddImeProvider(base::ListValue* list) { 248 void CrosLanguageOptionsHandler::AddImeProvider(base::ListValue* list) {
253 Profile* profile = Profile::FromWebUI(web_ui()); 249 Profile* profile = Profile::FromWebUI(web_ui());
254 const extensions::ExtensionSet& enabled_extensions = 250 const extensions::ExtensionSet& enabled_extensions =
255 extensions::ExtensionRegistry::Get(profile)->enabled_extensions(); 251 extensions::ExtensionRegistry::Get(profile)->enabled_extensions();
256 for (size_t i = 0; i < list->GetSize(); ++i) { 252 for (size_t i = 0; i < list->GetSize(); ++i) {
257 base::DictionaryValue* entry; 253 base::DictionaryValue* entry;
258 list->GetDictionary(i, &entry); 254 list->GetDictionary(i, &entry);
259 255
260 std::string input_method_id; 256 std::string input_method_id;
261 entry->GetString("id", &input_method_id); 257 entry->GetString("id", &input_method_id);
262 258
263 std::string extension_id = 259 std::string extension_id =
264 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id); 260 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id);
265 const extensions::Extension* extension = 261 const extensions::Extension* extension =
266 enabled_extensions.GetByID(extension_id); 262 enabled_extensions.GetByID(extension_id);
267 if (extension) 263 if (extension)
268 entry->SetString("extensionName", extension->name()); 264 entry->SetString("extensionName", extension->name());
269 } 265 }
270 } 266 }
271 267
272 } // namespace options 268 } // namespace options
273 } // namespace chromeos 269 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698