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

Side by Side Diff: ui/aura/window.cc

Issue 860983004: text input focus: Supports Window::GetFocusedTextInputClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « ui/aura/window.h ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 // static 640 // static
641 void Window::ConvertRectToTarget(const Window* source, 641 void Window::ConvertRectToTarget(const Window* source,
642 const Window* target, 642 const Window* target,
643 gfx::Rect* rect) { 643 gfx::Rect* rect) {
644 DCHECK(rect); 644 DCHECK(rect);
645 gfx::Point origin = rect->origin(); 645 gfx::Point origin = rect->origin();
646 ConvertPointToTarget(source, target, &origin); 646 ConvertPointToTarget(source, target, &origin);
647 rect->set_origin(origin); 647 rect->set_origin(origin);
648 } 648 }
649 649
650 ui::TextInputClient* Window::GetFocusedTextInputClient() {
651 return delegate_ ? delegate_->GetFocusedTextInputClient() : nullptr;
652 }
653
650 void Window::MoveCursorTo(const gfx::Point& point_in_window) { 654 void Window::MoveCursorTo(const gfx::Point& point_in_window) {
651 Window* root_window = GetRootWindow(); 655 Window* root_window = GetRootWindow();
652 DCHECK(root_window); 656 DCHECK(root_window);
653 gfx::Point point_in_root(point_in_window); 657 gfx::Point point_in_root(point_in_window);
654 ConvertPointToTarget(this, root_window, &point_in_root); 658 ConvertPointToTarget(this, root_window, &point_in_root);
655 root_window->GetHost()->MoveCursorTo(point_in_root); 659 root_window->GetHost()->MoveCursorTo(point_in_root);
656 } 660 }
657 661
658 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const { 662 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const {
659 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor; 663 return delegate_ ? delegate_->GetCursor(point) : gfx::kNullCursor;
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 return window; 1464 return window;
1461 if (offset) 1465 if (offset)
1462 *offset += window->bounds().OffsetFromOrigin(); 1466 *offset += window->bounds().OffsetFromOrigin();
1463 } 1467 }
1464 if (offset) 1468 if (offset)
1465 *offset = gfx::Vector2d(); 1469 *offset = gfx::Vector2d();
1466 return NULL; 1470 return NULL;
1467 } 1471 }
1468 1472
1469 } // namespace aura 1473 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698