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

Side by Side Diff: chrome/browser/extensions/extension_input_api.cc

Issue 7058046: Adjust virtual keyboard size base on input method candidates. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extensions/extension_input_api.h" 5 #include "chrome/browser/extensions/extension_input_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 #if defined(TOUCH_UI) 139 #if defined(TOUCH_UI)
140 bool HideKeyboardFunction::RunImpl() { 140 bool HideKeyboardFunction::RunImpl() {
141 NotificationService::current()->Notify( 141 NotificationService::current()->Notify(
142 NotificationType::HIDE_KEYBOARD_INVOKED, 142 NotificationType::HIDE_KEYBOARD_INVOKED,
143 Source<HideKeyboardFunction>(this), 143 Source<HideKeyboardFunction>(this),
144 NotificationService::NoDetails()); 144 NotificationService::NoDetails());
145 return true; 145 return true;
146 } 146 }
147
148 bool SetKeyboardHeightFunction::RunImpl() {
149 int height = 0;
150 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &height));
151 NotificationService::current()->Notify(
152 NotificationType::SET_KEYBOARD_HEIGHT_INVOKED,
153 Source<SetKeyboardHeightFunction>(this),
154 Details<int>(&height));
155 return true;
156 }
147 #endif 157 #endif
148 158
149 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) 159 #if defined(OS_CHROMEOS) && defined(TOUCH_UI)
150 // TODO(yusukes): This part should be moved to extension_input_api_chromeos.cc. 160 // TODO(yusukes): This part should be moved to extension_input_api_chromeos.cc.
151 bool SendHandwritingStrokeFunction::RunImpl() { 161 bool SendHandwritingStrokeFunction::RunImpl() {
152 chromeos::CrosLibrary* cros_library = chromeos::CrosLibrary::Get(); 162 chromeos::CrosLibrary* cros_library = chromeos::CrosLibrary::Get();
153 if (!cros_library->EnsureLoaded()) { 163 if (!cros_library->EnsureLoaded()) {
154 error_ = kCrosLibraryNotLoadedError; 164 error_ = kCrosLibraryNotLoadedError;
155 return false; 165 return false;
156 } 166 }
(...skipping 26 matching lines...) Expand all
183 // TODO(yusukes): Add a parameter for an input context ID. 193 // TODO(yusukes): Add a parameter for an input context ID.
184 int stroke_count = 0; // zero means 'clear all strokes'. 194 int stroke_count = 0; // zero means 'clear all strokes'.
185 if (HasOptionalArgument(0)) { 195 if (HasOptionalArgument(0)) {
186 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); 196 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count));
187 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); 197 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0);
188 } 198 }
189 cros_library->GetInputMethodLibrary()->CancelHandwritingStrokes(stroke_count); 199 cros_library->GetInputMethodLibrary()->CancelHandwritingStrokes(stroke_count);
190 return true; 200 return true;
191 } 201 }
192 #endif 202 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698