| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/client/core/feedback/blimp_feedback_data.h" | 5 #include "blimp/client/core/feedback/blimp_feedback_data.h" |
| 6 | 6 |
| 7 #include "blimp/client/core/contents/blimp_contents_manager.h" | 7 #include "blimp/client/core/contents/blimp_contents_manager.h" |
| 8 | 8 |
| 9 namespace blimp { | 9 namespace blimp { |
| 10 namespace client { | 10 namespace client { |
| 11 const char kFeedbackSupportedKey[] = "Blimp Supported"; | 11 const char kFeedbackSupportedKey[] = "Blimp Supported"; |
| 12 const char kFeedbackHasVisibleBlimpContents[] = "Blimp Visible"; | 12 const char kFeedbackHasVisibleBlimpContents[] = "Blimp Visible"; |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 std::string HasVisibleBlimpContents( | 15 std::string HasVisibleBlimpContents( |
| 16 BlimpContentsManager* blimp_contents_manager) { | 16 BlimpContentsManager* blimp_contents_manager) { |
| 17 std::vector<BlimpContentsImpl*> all_blimp_contents = | 17 std::vector<BlimpContentsImpl*> all_blimp_contents = |
| 18 blimp_contents_manager->GetAllActiveBlimpContents(); | 18 blimp_contents_manager->GetAllActiveBlimpContents(); |
| 19 for (const auto& item : all_blimp_contents) { | 19 for (const auto& item : all_blimp_contents) { |
| 20 if (item->compositor_manager()->visible()) { | 20 if (item->document_manager()->visible()) { |
| 21 return "true"; | 21 return "true"; |
| 22 } | 22 } |
| 23 } | 23 } |
| 24 return "false"; | 24 return "false"; |
| 25 } | 25 } |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 std::unordered_map<std::string, std::string> CreateBlimpFeedbackData( | 28 std::unordered_map<std::string, std::string> CreateBlimpFeedbackData( |
| 29 BlimpContentsManager* blimp_contents_manager) { | 29 BlimpContentsManager* blimp_contents_manager) { |
| 30 std::unordered_map<std::string, std::string> data; | 30 std::unordered_map<std::string, std::string> data; |
| 31 data.insert(std::make_pair(kFeedbackSupportedKey, "true")); | 31 data.insert(std::make_pair(kFeedbackSupportedKey, "true")); |
| 32 data.insert(std::make_pair(kFeedbackHasVisibleBlimpContents, | 32 data.insert(std::make_pair(kFeedbackHasVisibleBlimpContents, |
| 33 HasVisibleBlimpContents(blimp_contents_manager))); | 33 HasVisibleBlimpContents(blimp_contents_manager))); |
| 34 return data; | 34 return data; |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace client | 37 } // namespace client |
| 38 } // namespace blimp | 38 } // namespace blimp |
| OLD | NEW |