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

Unified Diff: services/ui/view_manager/view_associate_table.h

Issue 1949233002: Create a RegisterViewAssociate method in ViewManager (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: tiny bit more cleanup Created 4 years, 7 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
Index: services/ui/view_manager/view_associate_table.h
diff --git a/services/ui/view_manager/view_associate_table.h b/services/ui/view_manager/view_associate_table.h
index 9cdc71b84eb78910e3eadde605baca78a690c6ae..7327303bc3029d6c5a79937aa5017a4250bebb78 100644
--- a/services/ui/view_manager/view_associate_table.h
+++ b/services/ui/view_manager/view_associate_table.h
@@ -17,8 +17,14 @@
namespace view_manager {
+namespace test {
+class ViewAssociateTableTest;
+}
+
// Maintains a table of all connected view associates.
class ViewAssociateTable {
+ friend class test::ViewAssociateTableTest;
jeffbrown 2016/05/11 23:44:20 should be in the private section, but I think you
mikejurka 2016/05/16 23:35:18 why should it be in the private section?
+
public:
using AssociateConnectionErrorCallback =
base::Callback<void(const std::string&)>;
@@ -35,6 +41,11 @@ class ViewAssociateTable {
const std::vector<std::string>& urls,
const AssociateConnectionErrorCallback& connection_error_callback);
+ void RegisterViewAssociate(
+ mojo::ui::ViewInspector* inspector,
+ mojo::ui::ViewAssociatePtr associate,
+ const AssociateConnectionErrorCallback& connection_error_callback);
+
// Connects to services offered by the view associates.
void ConnectToViewService(mojo::ui::ViewTokenPtr view_token,
const mojo::String& service_name,
@@ -49,15 +60,17 @@ class ViewAssociateTable {
private:
struct AssociateData {
- AssociateData(const std::string& url, mojo::ui::ViewInspector* inspector);
+ AssociateData(mojo::ui::ViewAssociatePtr associate,
+ mojo::ui::ViewInspector* inspector);
~AssociateData();
- const std::string url;
mojo::ui::ViewAssociatePtr associate;
mojo::ui::ViewAssociateInfoPtr info;
mojo::Binding<mojo::ui::ViewInspector> inspector_binding;
};
+ void OnAssociateConnectionError(AssociateData* associate_data);
+
std::vector<std::unique_ptr<AssociateData>> associates_;
uint32_t pending_connection_count_ = 0u;

Powered by Google App Engine
This is Rietveld 408576698