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/virtual_keyboard/virtual_keyboard_manager.h" | 5 #include "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/extensions/extension_event_router.h" | 9 #include "chrome/browser/extensions/extension_event_router.h" |
10 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 10 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 break; | 390 break; |
391 } | 391 } |
392 default: { | 392 default: { |
393 NOTREACHED(); | 393 NOTREACHED(); |
394 args.Append(Value::CreateStringValue("none")); | 394 args.Append(Value::CreateStringValue("none")); |
395 break; | 395 break; |
396 } | 396 } |
397 } | 397 } |
398 | 398 |
399 std::string json_args; | 399 std::string json_args; |
400 base::JSONWriter::Write(&args, false, &json_args); | 400 base::JSONWriter::Write(&args, &json_args); |
401 | 401 |
402 Profile* profile = | 402 Profile* profile = |
403 Profile::FromBrowserContext( | 403 Profile::FromBrowserContext( |
404 dom_view_->dom_contents()->web_contents()->GetBrowserContext()); | 404 dom_view_->dom_contents()->web_contents()->GetBrowserContext()); |
405 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 405 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
406 kOnTextInputTypeChanged, json_args, NULL, GURL()); | 406 kOnTextInputTypeChanged, json_args, NULL, GURL()); |
407 | 407 |
408 if (type == ui::TEXT_INPUT_TYPE_NONE) | 408 if (type == ui::TEXT_INPUT_TYPE_NONE) |
409 Hide(); | 409 Hide(); |
410 else | 410 else |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 | 529 |
530 void VirtualKeyboardManager::OnWidgetClosing(views::Widget* widget) { | 530 void VirtualKeyboardManager::OnWidgetClosing(views::Widget* widget) { |
531 DCHECK_EQ(keyboard_, widget); | 531 DCHECK_EQ(keyboard_, widget); |
532 keyboard_ = NULL; | 532 keyboard_ = NULL; |
533 } | 533 } |
534 | 534 |
535 // static | 535 // static |
536 VirtualKeyboardManager* VirtualKeyboardManager::GetInstance() { | 536 VirtualKeyboardManager* VirtualKeyboardManager::GetInstance() { |
537 return Singleton<VirtualKeyboardManager>::get(); | 537 return Singleton<VirtualKeyboardManager>::get(); |
538 } | 538 } |
OLD | NEW |