| OLD | NEW |
| 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_UTIL_H_ | 5 #ifndef CHROME_BROWSER_FEEDBACK_FEEDBACK_UTIL_H_ |
| 6 #define CHROME_BROWSER_FEEDBACK_FEEDBACK_UTIL_H_ | 6 #define CHROME_BROWSER_FEEDBACK_FEEDBACK_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "chrome/browser/feedback/feedback_data.h" | 12 #include "chrome/browser/feedback/feedback_data.h" |
| 13 #include "chrome/browser/feedback/proto/common.pb.h" | 13 #include "chrome/browser/feedback/proto/common.pb.h" |
| 14 #include "chrome/browser/feedback/proto/dom.pb.h" | 14 #include "chrome/browser/feedback/proto/dom.pb.h" |
| 15 #include "chrome/browser/feedback/proto/extension.pb.h" | 15 #include "chrome/browser/feedback/proto/extension.pb.h" |
| 16 #include "chrome/browser/feedback/proto/math.pb.h" | 16 #include "chrome/browser/feedback/proto/math.pb.h" |
| 17 #include "chrome/browser/ui/webui/screenshot_source.h" | 17 #include "chrome/browser/ui/webui/screenshot_source.h" |
| 18 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
| 19 | 19 |
| 20 #if defined(OS_MACOSX) | 20 #if defined(OS_MACOSX) |
| 21 #include "base/sys_info.h" | 21 #include "base/sys_info.h" |
| 22 #elif defined(OS_WIN) | 22 #elif defined(OS_WIN) |
| 23 #include "base/win/windows_version.h" | 23 #include "base/win/windows_version.h" |
| 24 #elif defined(OS_CHROMEOS) | 24 #elif defined(OS_CHROMEOS) |
| 25 #include "chrome/browser/chromeos/cros/cros_library.h" | 25 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 26 #include "chrome/browser/chromeos/system/syslogs_provider.h" | |
| 27 #endif | 26 #endif |
| 28 | 27 |
| 29 class Profile; | 28 class Profile; |
| 30 | 29 |
| 31 namespace content { | 30 namespace content { |
| 32 class WebContents; | 31 class WebContents; |
| 33 } | 32 } |
| 34 | 33 |
| 35 extern const char kSyncDataKey[]; | |
| 36 | |
| 37 #if defined(OS_CHROMEOS) | |
| 38 extern const char kHUDLogDataKey[]; | |
| 39 #endif | |
| 40 | |
| 41 class FeedbackUtil { | 34 class FeedbackUtil { |
| 42 public: | 35 public: |
| 43 | 36 |
| 44 #if defined(OS_MACOSX) | 37 #if defined(OS_MACOSX) |
| 45 enum BugType { | 38 enum BugType { |
| 46 PAGE_WONT_LOAD = 0, | 39 PAGE_WONT_LOAD = 0, |
| 47 PAGE_LOOKS_ODD, | 40 PAGE_LOOKS_ODD, |
| 48 PHISHING_PAGE, | 41 PHISHING_PAGE, |
| 49 CANT_SIGN_IN, | 42 CANT_SIGN_IN, |
| 50 CHROME_MISBEHAVES, | 43 CHROME_MISBEHAVES, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 65 // is probably the right one to extend, but will require changing | 58 // is probably the right one to extend, but will require changing |
| 66 // all the call sites or making it a wrapper around another util. | 59 // all the call sites or making it a wrapper around another util. |
| 67 static void SetOSVersion(std::string *os_version); | 60 static void SetOSVersion(std::string *os_version); |
| 68 | 61 |
| 69 // Send the feedback report after the specified delay | 62 // Send the feedback report after the specified delay |
| 70 static void DispatchFeedback(Profile* profile, | 63 static void DispatchFeedback(Profile* profile, |
| 71 std::string* feedback_data, | 64 std::string* feedback_data, |
| 72 int64 delay); | 65 int64 delay); |
| 73 | 66 |
| 74 // Generates bug report data. | 67 // Generates bug report data. |
| 75 static void SendReport(const FeedbackData& data); | 68 static void SendReport(scoped_refptr<FeedbackData> data); |
| 76 // Redirects the user to Google's phishing reporting page. | 69 // Redirects the user to Google's phishing reporting page. |
| 77 static void ReportPhishing(content::WebContents* current_tab, | 70 static void ReportPhishing(content::WebContents* current_tab, |
| 78 const std::string& phishing_url); | 71 const std::string& phishing_url); |
| 79 // Maintains a single vector of bytes to store the last screenshot taken. | 72 // Maintains a single vector of bytes to store the last screenshot taken. |
| 80 static std::vector<unsigned char>* GetScreenshotPng(); | 73 static std::vector<unsigned char>* GetScreenshotPng(); |
| 81 static void ClearScreenshotPng(); | 74 static void ClearScreenshotPng(); |
| 82 static void SetScreenshotSize(const gfx::Rect& rect); | 75 static void SetScreenshotSize(const gfx::Rect& rect); |
| 83 static gfx::Rect& GetScreenshotSize(); | 76 static gfx::Rect& GetScreenshotSize(); |
| 84 | 77 |
| 85 class PostCleanup; | 78 class PostCleanup; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 96 int64 previous_delay); | 89 int64 previous_delay); |
| 97 | 90 |
| 98 #if defined(OS_CHROMEOS) | 91 #if defined(OS_CHROMEOS) |
| 99 static bool ValidFeedbackSize(const std::string& content); | 92 static bool ValidFeedbackSize(const std::string& content); |
| 100 #endif | 93 #endif |
| 101 | 94 |
| 102 DISALLOW_IMPLICIT_CONSTRUCTORS(FeedbackUtil); | 95 DISALLOW_IMPLICIT_CONSTRUCTORS(FeedbackUtil); |
| 103 }; | 96 }; |
| 104 | 97 |
| 105 #endif // CHROME_BROWSER_FEEDBACK_FEEDBACK_UTIL_H_ | 98 #endif // CHROME_BROWSER_FEEDBACK_FEEDBACK_UTIL_H_ |
| OLD | NEW |