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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_diagnosis_runner.cc

Issue 225183018: Move feedback files into src/components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove chrome/ from gyp files Created 6 years, 8 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 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 "chrome/browser/chromeos/app_mode/kiosk_diagnosis_runner.h" 5 #include "chrome/browser/chromeos/app_mode/kiosk_diagnosis_runner.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 service->GetSystemInformation( 89 service->GetSystemInformation(
90 base::Bind(&KioskDiagnosisRunner::SendSysLogFeedback, 90 base::Bind(&KioskDiagnosisRunner::SendSysLogFeedback,
91 weak_factory_.GetWeakPtr())); 91 weak_factory_.GetWeakPtr()));
92 } 92 }
93 93
94 void KioskDiagnosisRunner::SendSysLogFeedback( 94 void KioskDiagnosisRunner::SendSysLogFeedback(
95 const extensions::SystemInformationList& sys_info) { 95 const extensions::SystemInformationList& sys_info) {
96 scoped_refptr<FeedbackData> feedback_data(new FeedbackData()); 96 scoped_refptr<FeedbackData> feedback_data(new FeedbackData());
97 97
98 feedback_data->set_profile(profile_); 98 feedback_data->set_context(profile_);
99 feedback_data->set_description(base::StringPrintf( 99 feedback_data->set_description(base::StringPrintf(
100 "Autogenerated feedback:\nAppId: %s\n(uniquifier:%s)", 100 "Autogenerated feedback:\nAppId: %s\n(uniquifier:%s)",
101 app_id_.c_str(), 101 app_id_.c_str(),
102 base::Int64ToString(base::Time::Now().ToInternalValue()).c_str())); 102 base::Int64ToString(base::Time::Now().ToInternalValue()).c_str()));
103 103
104 scoped_ptr<FeedbackData::SystemLogsMap> sys_logs( 104 scoped_ptr<FeedbackData::SystemLogsMap> sys_logs(
105 new FeedbackData::SystemLogsMap); 105 new FeedbackData::SystemLogsMap);
106 for (extensions::SystemInformationList::const_iterator it = sys_info.begin(); 106 for (extensions::SystemInformationList::const_iterator it = sys_info.begin();
107 it != sys_info.end(); ++it) { 107 it != sys_info.end(); ++it) {
108 (*sys_logs.get())[it->get()->key] = it->get()->value; 108 (*sys_logs.get())[it->get()->key] = it->get()->value;
109 } 109 }
110 feedback_data->SetAndCompressSystemInfo(sys_logs.Pass()); 110 feedback_data->SetAndCompressSystemInfo(sys_logs.Pass());
111 111
112 extensions::FeedbackService* service = 112 extensions::FeedbackService* service =
113 extensions::FeedbackPrivateAPI::GetFactoryInstance() 113 extensions::FeedbackPrivateAPI::GetFactoryInstance()
114 ->Get(profile_) 114 ->Get(profile_)
115 ->GetService(); 115 ->GetService();
116 DCHECK(service); 116 DCHECK(service);
117 service->SendFeedback(profile_, 117 service->SendFeedback(profile_,
118 feedback_data, 118 feedback_data,
119 base::Bind(&KioskDiagnosisRunner::OnFeedbackSent, 119 base::Bind(&KioskDiagnosisRunner::OnFeedbackSent,
120 weak_factory_.GetWeakPtr())); 120 weak_factory_.GetWeakPtr()));
121 } 121 }
122 122
123 void KioskDiagnosisRunner::OnFeedbackSent(bool) { 123 void KioskDiagnosisRunner::OnFeedbackSent(bool) {
124 // Do nothing. 124 // Do nothing.
125 } 125 }
126 126
127 } // namespace chromeos 127 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698