OLD | NEW |
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/chromeos/keyboard_overlay_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 i != modifier_map.end(); ++i) { | 400 i != modifier_map.end(); ++i) { |
401 dict.SetString(ModifierKeyToLabel(i->first), ModifierKeyToLabel(i->second)); | 401 dict.SetString(ModifierKeyToLabel(i->first), ModifierKeyToLabel(i->second)); |
402 } | 402 } |
403 | 403 |
404 web_ui()->CallJavascriptFunctionUnsafe("initIdentifierMap", dict); | 404 web_ui()->CallJavascriptFunctionUnsafe("initIdentifierMap", dict); |
405 } | 405 } |
406 | 406 |
407 void KeyboardOverlayHandler::OpenLearnMorePage(const base::ListValue* args) { | 407 void KeyboardOverlayHandler::OpenLearnMorePage(const base::ListValue* args) { |
408 web_ui()->GetWebContents()->GetDelegate()->OpenURLFromTab( | 408 web_ui()->GetWebContents()->GetDelegate()->OpenURLFromTab( |
409 web_ui()->GetWebContents(), | 409 web_ui()->GetWebContents(), |
410 content::OpenURLParams(GURL(kLearnMoreURL), | 410 content::OpenURLParams(GURL(kLearnMoreURL), content::Referrer(), |
411 content::Referrer(), | 411 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
412 NEW_FOREGROUND_TAB, | 412 ui::PAGE_TRANSITION_LINK, false)); |
413 ui::PAGE_TRANSITION_LINK, | |
414 false)); | |
415 } | 413 } |
416 | 414 |
417 //////////////////////////////////////////////////////////////////////////////// | 415 //////////////////////////////////////////////////////////////////////////////// |
418 // | 416 // |
419 // KeyboardOverlayUI | 417 // KeyboardOverlayUI |
420 // | 418 // |
421 //////////////////////////////////////////////////////////////////////////////// | 419 //////////////////////////////////////////////////////////////////////////////// |
422 | 420 |
423 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) | 421 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) |
424 : WebDialogUI(web_ui) { | 422 : WebDialogUI(web_ui) { |
425 Profile* profile = Profile::FromWebUI(web_ui); | 423 Profile* profile = Profile::FromWebUI(web_ui); |
426 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); | 424 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); |
427 web_ui->AddMessageHandler(handler); | 425 web_ui->AddMessageHandler(handler); |
428 | 426 |
429 // Set up the chrome://keyboardoverlay/ source. | 427 // Set up the chrome://keyboardoverlay/ source. |
430 content::WebUIDataSource::Add(profile, | 428 content::WebUIDataSource::Add(profile, |
431 CreateKeyboardOverlayUIHTMLSource(profile)); | 429 CreateKeyboardOverlayUIHTMLSource(profile)); |
432 } | 430 } |
OLD | NEW |