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 "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 // The handler for Javascript messages related to the "keyboardoverlay" view. | 275 // The handler for Javascript messages related to the "keyboardoverlay" view. |
276 class KeyboardOverlayHandler | 276 class KeyboardOverlayHandler |
277 : public WebUIMessageHandler, | 277 : public WebUIMessageHandler, |
278 public base::SupportsWeakPtr<KeyboardOverlayHandler> { | 278 public base::SupportsWeakPtr<KeyboardOverlayHandler> { |
279 public: | 279 public: |
280 explicit KeyboardOverlayHandler(Profile* profile); | 280 explicit KeyboardOverlayHandler(Profile* profile); |
281 virtual ~KeyboardOverlayHandler(); | 281 virtual ~KeyboardOverlayHandler(); |
282 | 282 |
283 // WebUIMessageHandler implementation. | 283 // WebUIMessageHandler implementation. |
284 virtual void RegisterMessages() OVERRIDE; | 284 virtual void RegisterMessages() override; |
285 | 285 |
286 private: | 286 private: |
287 // Called when the page requires the input method ID corresponding to the | 287 // Called when the page requires the input method ID corresponding to the |
288 // current input method or keyboard layout during initialization. | 288 // current input method or keyboard layout during initialization. |
289 void GetInputMethodId(const base::ListValue* args); | 289 void GetInputMethodId(const base::ListValue* args); |
290 | 290 |
291 // Called when the page requres the information of modifier key remapping | 291 // Called when the page requres the information of modifier key remapping |
292 // during the initialization. | 292 // during the initialization. |
293 void GetLabelMap(const base::ListValue* args); | 293 void GetLabelMap(const base::ListValue* args); |
294 | 294 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 | 374 |
375 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) | 375 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) |
376 : WebDialogUI(web_ui) { | 376 : WebDialogUI(web_ui) { |
377 Profile* profile = Profile::FromWebUI(web_ui); | 377 Profile* profile = Profile::FromWebUI(web_ui); |
378 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); | 378 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); |
379 web_ui->AddMessageHandler(handler); | 379 web_ui->AddMessageHandler(handler); |
380 | 380 |
381 // Set up the chrome://keyboardoverlay/ source. | 381 // Set up the chrome://keyboardoverlay/ source. |
382 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource()); | 382 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource()); |
383 } | 383 } |
OLD | NEW |