| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // TODO(satorux): | 5 // TODO(satorux): |
| 6 // - Implement a scroll bar or an indicator showing where you are in the | 6 // - Implement a scroll bar or an indicator showing where you are in the |
| 7 // candidate window. | 7 // candidate window. |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 class CandidateView; | 83 class CandidateView; |
| 84 | 84 |
| 85 // CandidateWindowView is the main container of the candidate window UI. | 85 // CandidateWindowView is the main container of the candidate window UI. |
| 86 class CandidateWindowView : public views::View { | 86 class CandidateWindowView : public views::View { |
| 87 public: | 87 public: |
| 88 // The object can be monitored by the observer. | 88 // The object can be monitored by the observer. |
| 89 class Observer { | 89 class Observer { |
| 90 public: | 90 public: |
| 91 virtual ~Observer() {} | 91 virtual ~Observer() {} |
| 92 // The function is called when a candidate is committed. | 92 // The function is called when a candidate is committed. |
| 93 // See comments at NotifyCandidateClicke() in chromeos_ime.h for | 93 // See comments at NotifyCandidateClicke() in chromeos_input_method_ui.h for |
| 94 // details about the parameters. | 94 // details about the parameters. |
| 95 virtual void OnCandidateCommitted(int index, int button, int flag) = 0; | 95 virtual void OnCandidateCommitted(int index, int button, int flag) = 0; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 explicit CandidateWindowView(views::Widget* parent_frame); | 98 explicit CandidateWindowView(views::Widget* parent_frame); |
| 99 virtual ~CandidateWindowView() {} | 99 virtual ~CandidateWindowView() {} |
| 100 void Init(); | 100 void Init(); |
| 101 | 101 |
| 102 // Adds the given observer. The ownership is not transferred. | 102 // Adds the given observer. The ownership is not transferred. |
| 103 void AddObserver(Observer* observer) { | 103 void AddObserver(Observer* observer) { |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 // Create the candidate window controller. | 1007 // Create the candidate window controller. |
| 1008 chromeos::CandidateWindowController controller; | 1008 chromeos::CandidateWindowController controller; |
| 1009 controller.Init(); | 1009 controller.Init(); |
| 1010 | 1010 |
| 1011 // Start the main loop. | 1011 // Start the main loop. |
| 1012 views::AcceleratorHandler accelerator_handler; | 1012 views::AcceleratorHandler accelerator_handler; |
| 1013 MessageLoopForUI::current()->Run(&accelerator_handler); | 1013 MessageLoopForUI::current()->Run(&accelerator_handler); |
| 1014 | 1014 |
| 1015 return 0; | 1015 return 0; |
| 1016 } | 1016 } |
| OLD | NEW |