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

Side by Side Diff: chrome/browser/bug_report_util.h

Issue 9006003: Refactor and fix feedback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra include. Created 9 years 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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_BUG_REPORT_UTIL_H_
6 #define CHROME_BROWSER_BUG_REPORT_UTIL_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "chrome/browser/ui/webui/screenshot_source.h"
13 #include "chrome/browser/userfeedback/proto/common.pb.h"
14 #include "chrome/browser/userfeedback/proto/extension.pb.h"
15 #include "chrome/browser/userfeedback/proto/math.pb.h"
16 #include "ui/gfx/rect.h"
17
18 #if defined(OS_MACOSX)
19 #include "base/sys_info.h"
20 #elif defined(OS_WIN)
21 #include "base/win/windows_version.h"
22 #elif defined(OS_CHROMEOS)
23 #include "chrome/browser/chromeos/cros/cros_library.h"
24 #include "chrome/browser/chromeos/system/syslogs_provider.h"
25 #endif
26
27 class Profile;
28 class TabContents;
29
30 class BugReportUtil {
31 public:
32
33 #if defined(OS_MACOSX)
34 enum BugType {
35 PAGE_WONT_LOAD = 0,
36 PAGE_LOOKS_ODD,
37 PHISHING_PAGE,
38 CANT_SIGN_IN,
39 CHROME_MISBEHAVES,
40 SOMETHING_MISSING,
41 BROWSER_CRASH,
42 OTHER_PROBLEM
43 };
44 #endif
45
46
47 // SetOSVersion copies the maj.minor.build + servicePack_string
48 // into a string. We currently have:
49 // base::win::GetVersion returns WinVersion, which is just
50 // an enum of 2000, XP, 2003, or VISTA. Not enough detail for
51 // bug reports.
52 // base::SysInfo::OperatingSystemVersion returns an std::string
53 // but doesn't include the build or service pack. That function
54 // is probably the right one to extend, but will require changing
55 // all the call sites or making it a wrapper around another util.
56 static void SetOSVersion(std::string *os_version);
57
58 // Send the feedback report after the specified delay
59 static void DispatchFeedback(Profile* profile, std::string* feedback_data,
60 int64 delay);
61
62
63 // Generates bug report data.
64 static void SendReport(
65 Profile* profile
66 , int problem_type
67 , const std::string& page_url_text
68 , const std::string& description
69 , ScreenshotDataPtr png_data
70 , int png_width
71 , int png_height
72 #if defined(OS_CHROMEOS)
73 , const std::string& user_email_text
74 , const char* zipped_logs_data
75 , int zipped_logs_length
76 , const chromeos::system::LogDictionaryType* const sys_info
77 #endif
78 );
79 // Redirects the user to Google's phishing reporting page.
80 static void ReportPhishing(TabContents* currentTab,
81 const std::string& phishing_url);
82 // Maintains a single vector of bytes to store the last screenshot taken.
83 static std::vector<unsigned char>* GetScreenshotPng();
84 static void ClearScreenshotPng();
85 static void SetScreenshotSize(const gfx::Rect& rect);
86 static gfx::Rect& GetScreenshotSize();
87
88 class PostCleanup;
89
90 private:
91 // Add a key value pair to the feedback object
92 static void AddFeedbackData(
93 userfeedback::ExternalExtensionSubmit* feedback_data,
94 const std::string& key, const std::string& value);
95
96 // Send the feedback report
97 static void SendFeedback(Profile* profile, std::string* feedback_data,
98 int64 previous_delay);
99
100 #if defined(OS_CHROMEOS)
101 static bool ValidFeedbackSize(const std::string& content);
102 #endif
103
104 DISALLOW_IMPLICIT_CONSTRUCTORS(BugReportUtil);
105 };
106
107 #endif // CHROME_BROWSER_BUG_REPORT_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698