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

Side by Side Diff: chrome/browser/chromeos/login/touch_login_view.cc

Issue 7302015: A keyboard widget that manages itself (the animation and all that). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use the keyboard widget in the login screen too 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/chromeos/login/touch_login_view.h" 5 #include "chrome/browser/chromeos/login/touch_login_view.h"
6 6
7 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" 7 #include "chrome/browser/renderer_host/render_widget_host_view_views.h"
8 #include "chrome/browser/ui/touch/frame/keyboard_container_view.h" 8 #include "chrome/browser/ui/touch/frame/keyboard_container_view.h"
9 #include "chrome/browser/ui/touch/keyboard/keyboard_manager.h"
9 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h" 10 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h"
10 #include "chrome/browser/ui/views/dom_view.h" 11 #include "chrome/browser/ui/views/dom_view.h"
11 #include "content/browser/tab_contents/tab_contents.h" 12 #include "content/browser/tab_contents/tab_contents.h"
12 #include "content/common/notification_service.h" 13 #include "content/common/notification_service.h"
13 #include "views/controls/textfield/textfield.h" 14 #include "views/controls/textfield/textfield.h"
14 #include "views/widget/widget.h" 15 #include "views/widget/widget.h"
15 16
16 namespace { 17 namespace {
17 18
18 const char kViewClassName[] = "browser/chromeos/login/TouchLoginView"; 19 const char kViewClassName[] = "browser/chromeos/login/TouchLoginView";
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 100
100 // TouchLoginView private: ----------------------------------------------------- 101 // TouchLoginView private: -----------------------------------------------------
101 102
102 void TouchLoginView::InitVirtualKeyboard() { 103 void TouchLoginView::InitVirtualKeyboard() {
103 keyboard_ = new KeyboardContainerView(profile_, NULL); 104 keyboard_ = new KeyboardContainerView(profile_, NULL);
104 keyboard_->SetVisible(false); 105 keyboard_->SetVisible(false);
105 AddChildView(keyboard_); 106 AddChildView(keyboard_);
106 } 107 }
107 108
108 void TouchLoginView::UpdateKeyboardAndLayout(bool should_show_keyboard) { 109 void TouchLoginView::UpdateKeyboardAndLayout(bool should_show_keyboard) {
110 #if 0
109 DCHECK(keyboard_); 111 DCHECK(keyboard_);
110 if (should_show_keyboard == keyboard_showing_) 112 if (should_show_keyboard == keyboard_showing_)
111 return; 113 return;
112 keyboard_showing_ = should_show_keyboard; 114 keyboard_showing_ = should_show_keyboard;
113 Layout(); 115 Layout();
116 #else
117 if (should_show_keyboard)
118 KeyboardManager::GetInstance()->ShowKeyboardForWidget(GetWidget());
119 else
120 KeyboardManager::GetInstance()->Hide();
121 #endif
114 } 122 }
115 123
116 TouchLoginView::VirtualKeyboardType 124 TouchLoginView::VirtualKeyboardType
117 TouchLoginView::DecideKeyboardStateForView(views::View* view) { 125 TouchLoginView::DecideKeyboardStateForView(views::View* view) {
118 if (!view) 126 if (!view)
119 return NONE; 127 return NONE;
120 128
121 std::string cname = view->GetClassName(); 129 std::string cname = view->GetClassName();
122 if (cname == views::Textfield::kViewClassName) { 130 if (cname == views::Textfield::kViewClassName) {
123 return GENERIC; 131 return GENERIC;
(...skipping 24 matching lines...) Expand all
148 // can be determined after tab switching. 156 // can be determined after tab switching.
149 GetFocusedStateAccessor()->SetProperty( 157 GetFocusedStateAccessor()->SetProperty(
150 source_tab->property_bag(), editable); 158 source_tab->property_bag(), editable);
151 } else if (type == NotificationType::TAB_CONTENTS_DESTROYED) { 159 } else if (type == NotificationType::TAB_CONTENTS_DESTROYED) {
152 GetFocusedStateAccessor()->DeleteProperty( 160 GetFocusedStateAccessor()->DeleteProperty(
153 Source<TabContents>(source).ptr()->property_bag()); 161 Source<TabContents>(source).ptr()->property_bag());
154 } 162 }
155 } 163 }
156 164
157 } // namespace chromeos 165 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698