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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_engine.cc

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix cros, really Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/input_method/input_method_engine.h" 5 #include "chrome/browser/chromeos/input_method/input_method_engine.h"
6 6
7 #undef FocusIn 7 #undef FocusIn
8 #undef FocusOut 8 #undef FocusOut
9 #undef RootWindow 9 #undef RootWindow
10 #include <map> 10 #include <map>
(...skipping 20 matching lines...) Expand all
31 #include "ui/events/event_processor.h" 31 #include "ui/events/event_processor.h"
32 #include "ui/events/keycodes/dom4/keycode_converter.h" 32 #include "ui/events/keycodes/dom4/keycode_converter.h"
33 #include "ui/keyboard/keyboard_controller.h" 33 #include "ui/keyboard/keyboard_controller.h"
34 #include "ui/keyboard/keyboard_util.h" 34 #include "ui/keyboard/keyboard_util.h"
35 35
36 #if defined(USE_ATHENA) 36 #if defined(USE_ATHENA)
37 #include "athena/screen/public/screen_manager.h" 37 #include "athena/screen/public/screen_manager.h"
38 #endif 38 #endif
39 39
40 namespace chromeos { 40 namespace chromeos {
41 const char* kErrorNotActive = "IME is not active";
42 const char* kErrorWrongContext = "Context is not active";
43 const char* kCandidateNotFound = "Candidate not found";
44 41
45 namespace { 42 namespace {
46 43
44 const char kErrorNotActive[] = "IME is not active";
45 const char kErrorWrongContext[] = "Context is not active";
46 const char kCandidateNotFound[] = "Candidate not found";
47
47 // Notifies InputContextHandler that the composition is changed. 48 // Notifies InputContextHandler that the composition is changed.
48 void UpdateComposition(const CompositionText& composition_text, 49 void UpdateComposition(const CompositionText& composition_text,
49 uint32 cursor_pos, 50 uint32 cursor_pos,
50 bool is_visible) { 51 bool is_visible) {
51 IMEInputContextHandlerInterface* input_context = 52 IMEInputContextHandlerInterface* input_context =
52 IMEBridge::Get()->GetInputContextHandler(); 53 IMEBridge::Get()->GetInputContextHandler();
53 if (input_context) 54 if (input_context)
54 input_context->UpdateCompositionText( 55 input_context->UpdateCompositionText(
55 composition_text, cursor_pos, is_visible); 56 composition_text, cursor_pos, is_visible);
56 } 57 }
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 } 601 }
601 602
602 void InputMethodEngine::Reset() { 603 void InputMethodEngine::Reset() {
603 observer_->OnReset(active_component_id_); 604 observer_->OnReset(active_component_id_);
604 } 605 }
605 606
606 void InputMethodEngine::ProcessKeyEvent( 607 void InputMethodEngine::ProcessKeyEvent(
607 const ui::KeyEvent& key_event, 608 const ui::KeyEvent& key_event,
608 const KeyEventDoneCallback& callback) { 609 const KeyEventDoneCallback& callback) {
609 610
610 KeyEventDoneCallback *handler = new KeyEventDoneCallback(); 611 KeyEventDoneCallback* handler = new KeyEventDoneCallback();
611 *handler = callback; 612 *handler = callback;
612 613
613 KeyboardEvent ext_event; 614 KeyboardEvent ext_event;
614 GetExtensionKeyboardEventFromKeyEvent(key_event, &ext_event); 615 GetExtensionKeyboardEventFromKeyEvent(key_event, &ext_event);
615 616
616 // If the given key event is equal to the key event sent by 617 // If the given key event is equal to the key event sent by
617 // SendKeyEvents, this engine ID is propagated to the extension IME. 618 // SendKeyEvents, this engine ID is propagated to the extension IME.
618 // Note, this check relies on that ui::KeyEvent is propagated as 619 // Note, this check relies on that ui::KeyEvent is propagated as
619 // reference without copying. 620 // reference without copying.
620 if (&key_event == sent_key_event_) 621 if (&key_event == sent_key_event_)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 // TODO(nona): Implement it. 682 // TODO(nona): Implement it.
682 break; 683 break;
683 } 684 }
684 } 685 }
685 } 686 }
686 687
687 // TODO(nona): Support item.children. 688 // TODO(nona): Support item.children.
688 } 689 }
689 690
690 } // namespace chromeos 691 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698