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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 2323823004: Add action for each button on opt-in IME menu. (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_manager_impl.h" 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> // std::find 9 #include <algorithm> // std::find
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 #include <sstream> 12 #include <sstream>
13 #include <utility> 13 #include <utility>
14 14
15 #include "ash/shell.h"
15 #include "base/bind.h" 16 #include "base/bind.h"
16 #include "base/hash.h" 17 #include "base/hash.h"
17 #include "base/location.h" 18 #include "base/location.h"
18 #include "base/metrics/histogram_macros.h" 19 #include "base/metrics/histogram_macros.h"
19 #include "base/metrics/sparse_histogram.h" 20 #include "base/metrics/sparse_histogram.h"
20 #include "base/strings/string_split.h" 21 #include "base/strings/string_split.h"
21 #include "base/strings/string_util.h" 22 #include "base/strings/string_util.h"
22 #include "base/strings/stringprintf.h" 23 #include "base/strings/stringprintf.h"
23 #include "base/sys_info.h" 24 #include "base/sys_info.h"
24 #include "chrome/browser/browser_process.h" 25 #include "chrome/browser/browser_process.h"
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 if (is_ime_menu_activated_ == state_->menu_activated) 1207 if (is_ime_menu_activated_ == state_->menu_activated)
1207 return; 1208 return;
1208 1209
1209 is_ime_menu_activated_ = state_->menu_activated; 1210 is_ime_menu_activated_ = state_->menu_activated;
1210 FOR_EACH_OBSERVER(InputMethodManager::ImeMenuObserver, ime_menu_observers_, 1211 FOR_EACH_OBSERVER(InputMethodManager::ImeMenuObserver, ime_menu_observers_,
1211 ImeMenuActivationChanged(is_ime_menu_activated_)); 1212 ImeMenuActivationChanged(is_ime_menu_activated_));
1212 UMA_HISTOGRAM_BOOLEAN("InputMethod.ImeMenu.ActivationChanged", 1213 UMA_HISTOGRAM_BOOLEAN("InputMethod.ImeMenu.ActivationChanged",
1213 is_ime_menu_activated_); 1214 is_ime_menu_activated_);
1214 } 1215 }
1215 1216
1217 void InputMethodManagerImpl::ShowInputViewWithUrl(
Shu Chen 2016/09/11 08:33:25 Is there any reason why this interface/implement i
Azure Wei 2016/09/12 13:12:57 If 'on-screen keyboard' hasn't been enabled, we ne
1218 const std::string& appended_url) {
1219 GURL current_url = keyboard::GetOverrideContentUrl();
1220 GURL input_view_url =
1221 GetActiveIMEState()->GetCurrentInputMethod().input_view_url();
1222 if (current_url != input_view_url)
1223 return;
1224 GURL overriden_url = GURL(current_url.spec() + appended_url);
1225 keyboard::SetOverrideContentUrl(overriden_url);
1226
1227 keyboard::KeyboardController* keyboard_controller =
1228 keyboard::KeyboardController::GetInstance();
1229 if (keyboard_controller) {
1230 keyboard_controller->ShowKeyboard(false);
1231 return;
1232 }
1233
1234 if (keyboard::IsKeyboardEnabled())
1235 return;
1236
1237 // Forcibly enables the a11y onscreen keyboard if there is on keyboard enabled
1238 // for now. And re-disables it after showing once.
1239 keyboard::SetAccessibilityKeyboardEnabled(true);
1240 ash::Shell::GetInstance()->CreateKeyboard();
1241 keyboard_controller = keyboard::KeyboardController::GetInstance();
1242 if (!keyboard_controller) {
1243 keyboard::SetAccessibilityKeyboardEnabled(false);
1244 }
1245 keyboard_controller->ShowKeyboard(false);
1246 keyboard::SetAccessibilityKeyboardEnabled(false);
1247 }
1248
1216 } // namespace input_method 1249 } // namespace input_method
1217 } // namespace chromeos 1250 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698