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

Side by Side Diff: chrome/browser/feedback/feedback_data.h

Issue 23458031: Fix feedback attach a file and system info code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_FEEDBACK_FEEDBACK_DATA_H_ 5 #ifndef CHROME_BROWSER_FEEDBACK_FEEDBACK_DATA_H_
6 #define CHROME_BROWSER_FEEDBACK_FEEDBACK_DATA_H_ 6 #define CHROME_BROWSER_FEEDBACK_FEEDBACK_DATA_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "url/gurl.h" 14 #include "url/gurl.h"
15 15
16 namespace base { 16 namespace base {
17 class FilePath; 17 class FilePath;
18 } 18 }
19 class Profile; 19 class Profile;
20 20
21 class FeedbackData : public base::RefCountedThreadSafe<FeedbackData> { 21 class FeedbackData : public base::RefCountedThreadSafe<FeedbackData> {
22 public: 22 public:
23 typedef std::map<std::string, std::string> SystemLogsMap; 23 typedef std::map<std::string, std::string> SystemLogsMap;
24 24
25 static const char kScreensizeHeightKey[]; 25 static const char kScreensizeHeightKey[];
26 static const char kScreensizeWidthKey[]; 26 static const char kScreensizeWidthKey[];
27 27
28 FeedbackData(); 28 FeedbackData();
29 29
30 // Called once we've update all the data from the feedback page. 30 // Called once we've updated all the data from the feedback page.
31 void OnFeedbackPageDataComplete(); 31 void OnFeedbackPageDataComplete();
32 32
33 // Called once we have read our system logs. 33 // Sets the system information for this instance and kicks off its
34 void CompressSyslogs(scoped_ptr<SystemLogsMap> sys_info); 34 // compression.
35 void SetAndCompressSystemInfo(scoped_ptr<SystemLogsMap> sys_info);
35 36
36 // Called once we have read and compressed our system logs. 37 // Called once we have compressed our system logs.
37 void OnCompressLogsComplete(scoped_ptr<SystemLogsMap> sys_info, 38 void OnCompressLogsComplete(scoped_ptr<std::string> compressed_logs);
38 scoped_ptr<std::string> compressed_logs);
39 39
40 // Returns true if we've completed all the tasks needed before we can send 40 // Returns true if we've completed all the tasks needed before we can send
41 // feedback - at this time this is includes getting the feedback page data 41 // feedback - at this time this is includes getting the feedback page data
42 // and compressing the system logs. 42 // and compressing the system logs.
43 bool IsDataComplete(); 43 bool IsDataComplete();
44 44
45 // Sends the feedback report if we have all our data complete. 45 // Sends the feedback report if we have all our data complete.
46 void SendReport(); 46 void SendReport();
47 47
48 // Starts reading the file to attach to this report into the string
49 // file_data. ReadFileComplete is called once this is done.
50 void StartReadFile(const std::string filename, const std::string* file_data);
51
52 // Getters 48 // Getters
53 Profile* profile() const { return profile_; } 49 Profile* profile() const { return profile_; }
54 const std::string& category_tag() const { return category_tag_; } 50 const std::string& category_tag() const { return category_tag_; }
55 const std::string& page_url() const { return page_url_; } 51 const std::string& page_url() const { return page_url_; }
56 const std::string& description() const { return description_; } 52 const std::string& description() const { return description_; }
57 const std::string& user_email() const { return user_email_; } 53 const std::string& user_email() const { return user_email_; }
58 std::string* image() const { return image_.get(); } 54 std::string* image() const { return image_.get(); }
59 const std::string attached_filename() const { return attached_filename_; } 55 const std::string attached_filename() const { return attached_filename_; }
60 const GURL attached_file_url() const { return attached_file_url_; } 56 const GURL attached_file_url() const { return attached_file_url_; }
61 std::string* attached_filedata() const { return attached_filedata_.get(); } 57 std::string* attached_filedata() const { return attached_filedata_.get(); }
(...skipping 15 matching lines...) Expand all
77 } 73 }
78 void set_image(scoped_ptr<std::string> image) { image_ = image.Pass(); } 74 void set_image(scoped_ptr<std::string> image) { image_ = image.Pass(); }
79 void set_attached_filename(const std::string& attached_filename) { 75 void set_attached_filename(const std::string& attached_filename) {
80 attached_filename_ = attached_filename; 76 attached_filename_ = attached_filename;
81 } 77 }
82 void set_attached_filedata(scoped_ptr<std::string> attached_filedata) { 78 void set_attached_filedata(scoped_ptr<std::string> attached_filedata) {
83 attached_filedata_ = attached_filedata.Pass(); 79 attached_filedata_ = attached_filedata.Pass();
84 } 80 }
85 void set_attached_file_url(const GURL& url) { attached_file_url_ = url; } 81 void set_attached_file_url(const GURL& url) { attached_file_url_ = url; }
86 void set_screenshot_url(const GURL& url) { screenshot_url_ = url; } 82 void set_screenshot_url(const GURL& url) { screenshot_url_ = url; }
87 void set_sys_info(scoped_ptr<SystemLogsMap> sys_info);
88 83
89 private: 84 private:
90 friend class base::RefCountedThreadSafe<FeedbackData>; 85 friend class base::RefCountedThreadSafe<FeedbackData>;
91 86
92 virtual ~FeedbackData(); 87 virtual ~FeedbackData();
93 88
94 Profile* profile_; 89 Profile* profile_;
95 90
96 std::string category_tag_; 91 std::string category_tag_;
97 std::string page_url_; 92 std::string page_url_;
(...skipping 11 matching lines...) Expand all
109 104
110 bool feedback_page_data_complete_; 105 bool feedback_page_data_complete_;
111 bool syslogs_compression_complete_; 106 bool syslogs_compression_complete_;
112 107
113 bool report_sent_; 108 bool report_sent_;
114 109
115 DISALLOW_COPY_AND_ASSIGN(FeedbackData); 110 DISALLOW_COPY_AND_ASSIGN(FeedbackData);
116 }; 111 };
117 112
118 #endif // CHROME_BROWSER_FEEDBACK_FEEDBACK_DATA_H_ 113 #endif // CHROME_BROWSER_FEEDBACK_FEEDBACK_DATA_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/feedback_private/feedback_private_api.cc ('k') | chrome/browser/feedback/feedback_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698