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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 error_ = kKeyEventUnprocessedError; 130 error_ = kKeyEventUnprocessedError;
131 return false; 131 return false;
132 } 132 }
133 133
134 return true; 134 return true;
135 } 135 }
136 136
137 #if defined(TOUCH_UI) 137 #if defined(TOUCH_UI)
138 bool HideKeyboardFunction::RunImpl() { 138 bool HideKeyboardFunction::RunImpl() {
139 NotificationService::current()->Notify( 139 NotificationService::current()->Notify(
140 NotificationType::HIDE_KEYBOARD_INVOKED, 140 chrome::HIDE_KEYBOARD_INVOKED,
141 Source<HideKeyboardFunction>(this), 141 Source<HideKeyboardFunction>(this),
142 NotificationService::NoDetails()); 142 NotificationService::NoDetails());
143 return true; 143 return true;
144 } 144 }
145 145
146 bool SetKeyboardHeightFunction::RunImpl() { 146 bool SetKeyboardHeightFunction::RunImpl() {
147 int height = 0; 147 int height = 0;
148 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &height)); 148 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &height));
149 149
150 if (height < 0) { 150 if (height < 0) {
151 error_ = kInvalidHeight; 151 error_ = kInvalidHeight;
152 return false; 152 return false;
153 } 153 }
154 154
155 // TODO(penghuang) Check the height is not greater than height of browser view 155 // TODO(penghuang) Check the height is not greater than height of browser view
156 // and set the height of virtual keyboard directly instead of using 156 // and set the height of virtual keyboard directly instead of using
157 // notification. 157 // notification.
158 NotificationService::current()->Notify( 158 NotificationService::current()->Notify(
159 NotificationType::SET_KEYBOARD_HEIGHT_INVOKED, 159 chrome::SET_KEYBOARD_HEIGHT_INVOKED,
160 Source<SetKeyboardHeightFunction>(this), 160 Source<SetKeyboardHeightFunction>(this),
161 Details<int>(&height)); 161 Details<int>(&height));
162 return true; 162 return true;
163 } 163 }
164 #endif 164 #endif
165 165
166 #if defined(OS_CHROMEOS) && defined(TOUCH_UI) 166 #if defined(OS_CHROMEOS) && defined(TOUCH_UI)
167 // TODO(yusukes): This part should be moved to extension_input_api_chromeos.cc. 167 // TODO(yusukes): This part should be moved to extension_input_api_chromeos.cc.
168 bool SendHandwritingStrokeFunction::RunImpl() { 168 bool SendHandwritingStrokeFunction::RunImpl() {
169 // TODO(yusukes): Add a parameter for an input context ID. 169 // TODO(yusukes): Add a parameter for an input context ID.
(...skipping 20 matching lines...) Expand all
190 int stroke_count = 0; // zero means 'clear all strokes'. 190 int stroke_count = 0; // zero means 'clear all strokes'.
191 if (HasOptionalArgument(0)) { 191 if (HasOptionalArgument(0)) {
192 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count)); 192 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &stroke_count));
193 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0); 193 EXTENSION_FUNCTION_VALIDATE(stroke_count >= 0);
194 } 194 }
195 chromeos::input_method::InputMethodManager::GetInstance()-> 195 chromeos::input_method::InputMethodManager::GetInstance()->
196 CancelHandwritingStrokes(stroke_count); 196 CancelHandwritingStrokes(stroke_count);
197 return true; 197 return true;
198 } 198 }
199 #endif 199 #endif
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_infobar_delegate.cc ('k') | chrome/browser/extensions/extension_install_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698