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