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

Side by Side Diff: blimp/client/core/feedback/blimp_feedback_data.cc

Issue 2371503002: Add Blimp feedback data about visible BlimpContents. (Closed)
Patch Set: Rebased for good measure Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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
OLDNEW
« no previous file with comments | « blimp/client/core/feedback/blimp_feedback_data.h ('k') | blimp/client/core/feedback/blimp_feedback_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698