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

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

Issue 98703003: Mode Indicator using BubbleDelegateView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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/candidate_window_controller_impl. h" 5 #include "chrome/browser/chromeos/input_method/candidate_window_controller_impl. h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/shell_window_ids.h" 11 #include "ash/shell_window_ids.h"
12 #include "ash/wm/window_animations.h" 12 #include "ash/wm/window_animations.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "chrome/browser/chromeos/input_method/candidate_window_view.h" 16 #include "chrome/browser/chromeos/input_method/candidate_window_view.h"
17 #include "chrome/browser/chromeos/input_method/delayable_widget.h" 17 #include "chrome/browser/chromeos/input_method/delayable_widget.h"
18 #include "chrome/browser/chromeos/input_method/infolist_window_view.h" 18 #include "chrome/browser/chromeos/input_method/infolist_window_view.h"
19 #include "chrome/browser/chromeos/input_method/mode_indicator_controller.h" 19 #include "chrome/browser/chromeos/input_method/mode_indicator_controller.h"
20 #include "chrome/browser/chromeos/input_method/mode_indicator_widget.h"
21 #include "ui/views/widget/widget.h" 20 #include "ui/views/widget/widget.h"
22 21
23 22
24 namespace chromeos { 23 namespace chromeos {
25 namespace input_method { 24 namespace input_method {
26 25
27 namespace { 26 namespace {
28 // The milliseconds of the delay to show the infolist window. 27 // The milliseconds of the delay to show the infolist window.
29 const int kInfolistShowDelayMilliSeconds = 500; 28 const int kInfolistShowDelayMilliSeconds = 500;
30 // The milliseconds of the delay to hide the infolist window. 29 // The milliseconds of the delay to hide the infolist window.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 views::corewm::SetWindowVisibilityAnimationType( 75 views::corewm::SetWindowVisibilityAnimationType(
77 infolist_window_->GetNativeView(), 76 infolist_window_->GetNativeView(),
78 views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); 77 views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
79 78
80 InfolistWindowView* infolist_view = new InfolistWindowView; 79 InfolistWindowView* infolist_view = new InfolistWindowView;
81 infolist_view->Init(); 80 infolist_view->Init();
82 infolist_window_->SetContentsView(infolist_view); 81 infolist_window_->SetContentsView(infolist_view);
83 82
84 // Create the mode indicator controller. 83 // Create the mode indicator controller.
85 mode_indicator_controller_.reset( 84 mode_indicator_controller_.reset(
86 new ModeIndicatorController(new ModeIndicatorWidget)); 85 new ModeIndicatorController(InputMethodManager::Get()));
87 } 86 }
88 87
89 void CandidateWindowControllerImpl::Hide() { 88 void CandidateWindowControllerImpl::Hide() {
90 // To hide the candidate window we have to call HideLookupTable and 89 // To hide the candidate window we have to call HideLookupTable and
91 // HideAuxiliaryText. Without calling HideAuxiliaryText the 90 // HideAuxiliaryText. Without calling HideAuxiliaryText the
92 // auxiliary text area will remain. 91 // auxiliary text area will remain.
93 candidate_window_view_->HideLookupTable(); 92 candidate_window_view_->HideLookupTable();
94 candidate_window_view_->HideAuxiliaryText(); 93 candidate_window_view_->HideAuxiliaryText();
95 infolist_window_->Hide(); 94 infolist_window_->Hide();
96 } 95 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 309
311 if (candidate_window_view_rect.y() + infolist_window_size.height() > 310 if (candidate_window_view_rect.y() + infolist_window_size.height() >
312 screen_rect.bottom()) 311 screen_rect.bottom())
313 result.set_y(screen_rect.bottom() - infolist_window_size.height()); 312 result.set_y(screen_rect.bottom() - infolist_window_size.height());
314 313
315 return result; 314 return result;
316 } 315 }
317 316
318 } // namespace input_method 317 } // namespace input_method
319 } // namespace chromeos 318 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698