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

Side by Side Diff: chrome/browser/ui/touch/status_bubble_touch.cc

Issue 8044018: Move chrome/browser/ui/touch/keyboard* to chrome/browser/ui/virtual_keyboard/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merged ToT Created 9 years, 2 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) 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/status_bubble_touch.h" 5 #include "chrome/browser/ui/touch/status_bubble_touch.h"
6 6
7 #include "chrome/browser/ui/touch/keyboard/keyboard_manager.h" 7 #include "chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.h"
8 8
9 StatusBubbleTouch::StatusBubbleTouch(views::View* base_view) 9 StatusBubbleTouch::StatusBubbleTouch(views::View* base_view)
10 : StatusBubbleViews(base_view) { 10 : StatusBubbleViews(base_view) {
11 KeyboardManager::GetInstance()->keyboard()->AddObserver(this); 11 VirtualKeyboardManager::GetInstance()->keyboard()->AddObserver(this);
12 } 12 }
13 13
14 StatusBubbleTouch::~StatusBubbleTouch() { 14 StatusBubbleTouch::~StatusBubbleTouch() {
15 views::Widget* keyboard = KeyboardManager::GetInstance()->keyboard(); 15 views::Widget* keyboard = VirtualKeyboardManager::GetInstance()->keyboard();
16 if (keyboard) 16 if (keyboard)
17 keyboard->RemoveObserver(this); 17 keyboard->RemoveObserver(this);
18 } 18 }
19 19
20 void StatusBubbleTouch::Reposition() { 20 void StatusBubbleTouch::Reposition() {
21 StatusBubbleViews::Reposition(); 21 StatusBubbleViews::Reposition();
22 views::Widget* keyboard = KeyboardManager::GetInstance()->keyboard(); 22 views::Widget* keyboard = VirtualKeyboardManager::GetInstance()->keyboard();
23 if (popup() && keyboard && keyboard->IsVisible()) { 23 if (popup() && keyboard && keyboard->IsVisible()) {
24 gfx::Rect popup_screen = popup()->GetWindowScreenBounds(); 24 gfx::Rect popup_screen = popup()->GetWindowScreenBounds();
25 gfx::Rect keyboard_screen = keyboard->GetWindowScreenBounds(); 25 gfx::Rect keyboard_screen = keyboard->GetWindowScreenBounds();
26 if (popup_screen.Intersects(keyboard_screen)) { 26 if (popup_screen.Intersects(keyboard_screen)) {
27 // The keyboard may be hiding the popup. Reposition above the keyboard. 27 // The keyboard may be hiding the popup. Reposition above the keyboard.
28 popup_screen.set_y(keyboard_screen.y() - popup_screen.height()); 28 popup_screen.set_y(keyboard_screen.y() - popup_screen.height());
29 popup()->SetBounds(popup_screen); 29 popup()->SetBounds(popup_screen);
30 } 30 }
31 } 31 }
32 } 32 }
33 33
34 void StatusBubbleTouch::OnWidgetVisibilityChanged(views::Widget* widget, 34 void StatusBubbleTouch::OnWidgetVisibilityChanged(views::Widget* widget,
35 bool visible) { 35 bool visible) {
36 Reposition(); 36 Reposition();
37 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698