| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/services/view_manager/connection_manager.h" | 5 #include "mojo/services/view_manager/connection_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/public/cpp/application/application_connection.h" | 8 #include "mojo/public/cpp/application/application_connection.h" |
| 9 #include "mojo/public/interfaces/application/service_provider.mojom.h" | 9 #include "mojo/public/interfaces/application/service_provider.mojom.h" |
| 10 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" | 10 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 void ConnectionManager::OnConnectionMessagedClient(ConnectionSpecificId id) { | 123 void ConnectionManager::OnConnectionMessagedClient(ConnectionSpecificId id) { |
| 124 if (current_change_) | 124 if (current_change_) |
| 125 current_change_->MarkConnectionAsMessaged(id); | 125 current_change_->MarkConnectionAsMessaged(id); |
| 126 } | 126 } |
| 127 | 127 |
| 128 bool ConnectionManager::DidConnectionMessageClient( | 128 bool ConnectionManager::DidConnectionMessageClient( |
| 129 ConnectionSpecificId id) const { | 129 ConnectionSpecificId id) const { |
| 130 return current_change_ && current_change_->DidMessageConnection(id); | 130 return current_change_ && current_change_->DidMessageConnection(id); |
| 131 } | 131 } |
| 132 | 132 |
| 133 ViewManagerServiceImpl* ConnectionManager::GetConnectionByCreator( | |
| 134 ConnectionSpecificId creator_id, | |
| 135 const std::string& url) const { | |
| 136 for (ConnectionMap::const_iterator i = connection_map_.begin(); | |
| 137 i != connection_map_.end(); | |
| 138 ++i) { | |
| 139 if (i->second->creator_id() == creator_id && i->second->url() == url) | |
| 140 return i->second; | |
| 141 } | |
| 142 return NULL; | |
| 143 } | |
| 144 | |
| 145 const ViewManagerServiceImpl* ConnectionManager::GetConnectionWithRoot( | 133 const ViewManagerServiceImpl* ConnectionManager::GetConnectionWithRoot( |
| 146 const ViewId& id) const { | 134 const ViewId& id) const { |
| 147 for (ConnectionMap::const_iterator i = connection_map_.begin(); | 135 for (ConnectionMap::const_iterator i = connection_map_.begin(); |
| 148 i != connection_map_.end(); | 136 i != connection_map_.end(); |
| 149 ++i) { | 137 ++i) { |
| 150 if (i->second->HasRoot(id)) | 138 if (i->second->HasRoot(id)) |
| 151 return i->second; | 139 return i->second; |
| 152 } | 140 } |
| 153 return NULL; | 141 return NULL; |
| 154 } | 142 } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 display_manager_.SchedulePaint(view->parent(), old_bounds); | 256 display_manager_.SchedulePaint(view->parent(), old_bounds); |
| 269 display_manager_.SchedulePaint(view->parent(), new_bounds); | 257 display_manager_.SchedulePaint(view->parent(), new_bounds); |
| 270 } | 258 } |
| 271 | 259 |
| 272 void ConnectionManager::OnViewBitmapChanged(const ServerView* view) { | 260 void ConnectionManager::OnViewBitmapChanged(const ServerView* view) { |
| 273 display_manager_.SchedulePaint(view, gfx::Rect(view->bounds().size())); | 261 display_manager_.SchedulePaint(view, gfx::Rect(view->bounds().size())); |
| 274 } | 262 } |
| 275 | 263 |
| 276 } // namespace service | 264 } // namespace service |
| 277 } // namespace mojo | 265 } // namespace mojo |
| OLD | NEW |