OLD | NEW |
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/ui/touch/frame/touch_browser_frame_view.h" | 5 #include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" | 8 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" |
9 #include "chrome/browser/tabs/tab_strip_model.h" | 9 #include "chrome/browser/tabs/tab_strip_model.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "ui/base/animation/slide_animation.h" | 22 #include "ui/base/animation/slide_animation.h" |
23 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
24 #include "ui/gfx/transform.h" | 24 #include "ui/gfx/transform.h" |
25 #include "views/controls/button/image_button.h" | 25 #include "views/controls/button/image_button.h" |
26 #include "views/controls/textfield/textfield.h" | 26 #include "views/controls/textfield/textfield.h" |
27 #include "views/focus/focus_manager.h" | 27 #include "views/focus/focus_manager.h" |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 const int kDefaultKeyboardHeight = 300; | 31 const int kDefaultKeyboardHeight = 300; |
32 const int kKeyboardSlideDuration = 500; // In milliseconds | 32 const int kKeyboardSlideDuration = 300; // In milliseconds |
33 | 33 |
34 PropertyAccessor<bool>* GetFocusedStateAccessor() { | 34 PropertyAccessor<bool>* GetFocusedStateAccessor() { |
35 static PropertyAccessor<bool> state; | 35 static PropertyAccessor<bool> state; |
36 return &state; | 36 return &state; |
37 } | 37 } |
38 | 38 |
39 bool TabContentsHasFocus(const TabContents* contents) { | 39 bool TabContentsHasFocus(const TabContents* contents) { |
40 views::View* view = static_cast<TabContentsViewTouch*>(contents->view()); | 40 views::View* view = static_cast<TabContentsViewTouch*>(contents->view()); |
41 return view->Contains(view->GetFocusManager()->GetFocusedView()); | 41 return view->Contains(view->GetFocusManager()->GetFocusedView()); |
42 } | 42 } |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 RenderViewHost* host = | 333 RenderViewHost* host = |
334 browser_view()->browser()->GetSelectedTabContents()->render_view_host(); | 334 browser_view()->browser()->GetSelectedTabContents()->render_view_host(); |
335 host->Send(new ViewMsg_ScrollFocusedEditableNodeIntoView( | 335 host->Send(new ViewMsg_ScrollFocusedEditableNodeIntoView( |
336 host->routing_id())); | 336 host->routing_id())); |
337 } else { | 337 } else { |
338 // Notify the keyboard that it is hidden now. | 338 // Notify the keyboard that it is hidden now. |
339 keyboard_->SetVisible(false); | 339 keyboard_->SetVisible(false); |
340 } | 340 } |
341 SchedulePaint(); | 341 SchedulePaint(); |
342 } | 342 } |
OLD | NEW |