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

Side by Side Diff: ash/system/ime_menu/ime_list_view.cc

Issue 2805733002: [Ash] Use DCHECK in ImeListView::HandleButtonPressed() (Closed)
Patch Set: DCHECK_EQ Created 3 years, 8 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
« no previous file with comments | « ash/system/ime/tray_ime_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/system/ime_menu/ime_list_view.h" 5 #include "ash/system/ime_menu/ime_list_view.h"
6 6
7 #include "ash/resources/grit/ash_resources.h" 7 #include "ash/resources/grit/ash_resources.h"
8 #include "ash/resources/vector_icons/vector_icons.h" 8 #include "ash/resources/vector_icons/vector_icons.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_port.h" 10 #include "ash/shell_port.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 302 }
303 303
304 if (!should_focus_ime_after_selection_with_keyboard_ || 304 if (!should_focus_ime_after_selection_with_keyboard_ ||
305 !last_item_selected_with_keyboard_) { 305 !last_item_selected_with_keyboard_) {
306 CloseImeListView(); 306 CloseImeListView();
307 } 307 }
308 } 308 }
309 309
310 void ImeListView::HandleButtonPressed(views::Button* sender, 310 void ImeListView::HandleButtonPressed(views::Button* sender,
311 const ui::Event& event) { 311 const ui::Event& event) {
312 if (keyboard_status_row_ && sender == keyboard_status_row_->toggle()) { 312 DCHECK_EQ(sender, keyboard_status_row_->toggle());
313 ShellPort::Get()->ToggleIgnoreExternalKeyboard(); 313
314 last_selected_item_id_.clear(); 314 ShellPort::Get()->ToggleIgnoreExternalKeyboard();
315 last_item_selected_with_keyboard_ = false; 315 last_selected_item_id_.clear();
316 } 316 last_item_selected_with_keyboard_ = false;
317 } 317 }
318 318
319 void ImeListView::VisibilityChanged(View* starting_from, bool is_visible) { 319 void ImeListView::VisibilityChanged(View* starting_from, bool is_visible) {
320 if (!is_visible || (should_focus_ime_after_selection_with_keyboard_ && 320 if (!is_visible || (should_focus_ime_after_selection_with_keyboard_ &&
321 last_item_selected_with_keyboard_) || 321 last_item_selected_with_keyboard_) ||
322 !current_ime_view_) { 322 !current_ime_view_) {
323 return; 323 return;
324 } 324 }
325 325
326 scroll_content()->ScrollRectToVisible(current_ime_view_->bounds()); 326 scroll_content()->ScrollRectToVisible(current_ime_view_->bounds());
(...skipping 22 matching lines...) Expand all
349 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view) 349 ImeListViewTestApi::ImeListViewTestApi(ImeListView* ime_list_view)
350 : ime_list_view_(ime_list_view) {} 350 : ime_list_view_(ime_list_view) {}
351 351
352 ImeListViewTestApi::~ImeListViewTestApi() {} 352 ImeListViewTestApi::~ImeListViewTestApi() {}
353 353
354 views::View* ImeListViewTestApi::GetToggleView() const { 354 views::View* ImeListViewTestApi::GetToggleView() const {
355 return ime_list_view_->keyboard_status_row_->toggle(); 355 return ime_list_view_->keyboard_status_row_->toggle();
356 } 356 }
357 357
358 } // namespace ash 358 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/ime/tray_ime_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698