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

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: rebase, nit 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 21 matching lines...) Expand all
32 #include "ui/events/event_processor.h" 32 #include "ui/events/event_processor.h"
33 #include "ui/events/keycodes/dom4/keycode_converter.h" 33 #include "ui/events/keycodes/dom4/keycode_converter.h"
34 #include "ui/keyboard/keyboard_controller.h" 34 #include "ui/keyboard/keyboard_controller.h"
35 #include "ui/keyboard/keyboard_util.h" 35 #include "ui/keyboard/keyboard_util.h"
36 36
37 #if defined(USE_ATHENA) 37 #if defined(USE_ATHENA)
38 #include "athena/screen/public/screen_manager.h" 38 #include "athena/screen/public/screen_manager.h"
39 #endif 39 #endif
40 40
41 namespace chromeos { 41 namespace chromeos {
42 const char* kErrorNotActive = "IME is not active";
43 const char* kErrorWrongContext = "Context is not active";
44 const char* kCandidateNotFound = "Candidate not found";
45 42
46 namespace { 43 namespace {
47 44
45 const char kErrorNotActive[] = "IME is not active";
46 const char kErrorWrongContext[] = "Context is not active";
47 const char kCandidateNotFound[] = "Candidate not found";
48
48 // Notifies InputContextHandler that the composition is changed. 49 // Notifies InputContextHandler that the composition is changed.
49 void UpdateComposition(const CompositionText& composition_text, 50 void UpdateComposition(const CompositionText& composition_text,
50 uint32 cursor_pos, 51 uint32 cursor_pos,
51 bool is_visible) { 52 bool is_visible) {
52 IMEInputContextHandlerInterface* input_context = 53 IMEInputContextHandlerInterface* input_context =
53 IMEBridge::Get()->GetInputContextHandler(); 54 IMEBridge::Get()->GetInputContextHandler();
54 if (input_context) 55 if (input_context)
55 input_context->UpdateCompositionText( 56 input_context->UpdateCompositionText(
56 composition_text, cursor_pos, is_visible); 57 composition_text, cursor_pos, is_visible);
57 } 58 }
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 } 614 }
614 615
615 void InputMethodEngine::Reset() { 616 void InputMethodEngine::Reset() {
616 observer_->OnReset(active_component_id_); 617 observer_->OnReset(active_component_id_);
617 } 618 }
618 619
619 void InputMethodEngine::ProcessKeyEvent( 620 void InputMethodEngine::ProcessKeyEvent(
620 const ui::KeyEvent& key_event, 621 const ui::KeyEvent& key_event,
621 const KeyEventDoneCallback& callback) { 622 const KeyEventDoneCallback& callback) {
622 623
623 KeyEventDoneCallback *handler = new KeyEventDoneCallback(); 624 KeyEventDoneCallback* handler = new KeyEventDoneCallback();
624 *handler = callback; 625 *handler = callback;
625 626
626 KeyboardEvent ext_event; 627 KeyboardEvent ext_event;
627 GetExtensionKeyboardEventFromKeyEvent(key_event, &ext_event); 628 GetExtensionKeyboardEventFromKeyEvent(key_event, &ext_event);
628 629
629 // If the given key event is equal to the key event sent by 630 // If the given key event is equal to the key event sent by
630 // SendKeyEvents, this engine ID is propagated to the extension IME. 631 // SendKeyEvents, this engine ID is propagated to the extension IME.
631 // Note, this check relies on that ui::KeyEvent is propagated as 632 // Note, this check relies on that ui::KeyEvent is propagated as
632 // reference without copying. 633 // reference without copying.
633 if (&key_event == sent_key_event_) 634 if (&key_event == sent_key_event_)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 // TODO(nona): Implement it. 695 // TODO(nona): Implement it.
695 break; 696 break;
696 } 697 }
697 } 698 }
698 } 699 }
699 700
700 // TODO(nona): Support item.children. 701 // TODO(nona): Support item.children.
701 } 702 }
702 703
703 } // namespace chromeos 704 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_tasks.cc ('k') | chrome/browser/chromeos/login/chrome_restart_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698