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

Unified Diff: mojo/services/view_manager/view_manager_connection.cc

Issue 331563003: Launching + Views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/view_manager/view_manager_connection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/view_manager_connection.cc
diff --git a/mojo/services/view_manager/view_manager_connection.cc b/mojo/services/view_manager/view_manager_connection.cc
index c3053c0d5899575b48c79fd70fcb5d9168d6c87b..0d717ab413bc10235302be9add9df4543f1549e1 100644
--- a/mojo/services/view_manager/view_manager_connection.cc
+++ b/mojo/services/view_manager/view_manager_connection.cc
@@ -331,6 +331,11 @@ bool ViewManagerConnection::CanSetView(const Node* node,
return (view && view_id.connection_id == id_) || view_id == ViewId();
}
+bool ViewManagerConnection::CanSetFocus(const Node* node) const {
+ // TODO(beng): security.
+ return true;
+}
+
bool ViewManagerConnection::CanGetNodeTree(const Node* node) const {
return node &&
(IsNodeDescendantOfRoots(node) || node->id().connection_id == id_);
@@ -695,6 +700,17 @@ void ViewManagerConnection::SetViewContents(
callback.Run(true);
}
+void ViewManagerConnection::SetFocus(Id node_id,
+ const Callback<void(bool)> & callback) {
+ bool success = false;
+ Node* node = GetNode(NodeIdFromTransportId(node_id));
+ if (CanSetFocus(node)) {
+ success = true;
+ node->window()->Focus();
+ }
+ callback.Run(success);
+}
+
void ViewManagerConnection::SetNodeBounds(
Id node_id,
RectPtr bounds,
« no previous file with comments | « mojo/services/view_manager/view_manager_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698