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

Unified Diff: ui/base/ime/win/tsf_input_scope.cc

Issue 21130010: change TSFInputScope to have multiple InputScopes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ima_inputscope3
Patch Set: rename Created 7 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/win/tsf_input_scope.cc
diff --git a/ui/base/ime/win/tsf_input_scope.cc b/ui/base/ime/win/tsf_input_scope.cc
index dac701b0a8b85e41694515b1a90ec0affc81653f..01529812b69263e290a33c43ecf9caf127557e45 100644
--- a/ui/base/ime/win/tsf_input_scope.cc
+++ b/ui/base/ime/win/tsf_input_scope.cc
@@ -5,6 +5,7 @@
#include "ui/base/ime/win/tsf_input_scope.h"
#include <InputScope.h>
+#include <vector>
#include "base/compiler_specific.h"
#include "base/logging.h"
@@ -16,8 +17,8 @@ namespace {
class TSFInputScope : public ITfInputScope {
public:
- explicit TSFInputScope(InputScope input_scope)
- : input_scope_(input_scope),
+ explicit TSFInputScope(const std::vector<InputScope>& input_scopes)
+ : input_scopes_(input_scopes),
ref_count_(0) {}
// ITfInputScope:
@@ -51,13 +52,15 @@ class TSFInputScope : public ITfInputScope {
if (!count || !input_scopes)
return E_INVALIDARG;
*input_scopes = static_cast<InputScope*>(CoTaskMemAlloc(
- sizeof(InputScope)));
+ sizeof(InputScope) * input_scopes_.size()));
if (!input_scopes) {
*count = 0;
return E_OUTOFMEMORY;
}
- (*input_scopes)[0] = input_scope_;
- *count = 1;
+
+ for (size_t i = 0; i < input_scopes_.size(); ++i)
+ (*input_scopes)[i] = input_scopes_[i];
+ *count = input_scopes_.size();
return S_OK;
}
@@ -78,8 +81,8 @@ class TSFInputScope : public ITfInputScope {
}
private:
- // The corresponding text input type.
- InputScope input_scope_;
+ // The corresponding text input types.
+ std::vector<InputScope> input_scopes_;
// The refrence count of this instance.
volatile LONG ref_count_;
@@ -136,7 +139,9 @@ InputScope GetInputScopeType(TextInputType text_input_type) {
} // namespace
ITfInputScope* CreateInputScope(TextInputType text_input_type) {
- return new TSFInputScope(GetInputScopeType(text_input_type));
+ std::vector<InputScope> input_scopes(1);
+ input_scopes.push_back(GetInputScopeType(text_input_type));
+ return new TSFInputScope(input_scopes);
}
void SetInputScopeForTsfUnawareWindow(HWND window_handle,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698