| 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 #include "chrome/browser/feedback/feedback_util.h" | 5 #include "chrome/browser/feedback/feedback_util.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "third_party/icu/public/common/unicode/locid.h" | 39 #include "third_party/icu/public/common/unicode/locid.h" |
| 40 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
| 41 | 41 |
| 42 #if defined(USE_ASH) | 42 #if defined(USE_ASH) |
| 43 #include "ash/shell.h" | 43 #include "ash/shell.h" |
| 44 #include "ash/shell_delegate.h" | 44 #include "ash/shell_delegate.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 using content::WebContents; | 47 using content::WebContents; |
| 48 | 48 |
| 49 namespace chrome { |
| 50 |
| 49 const char kSyncDataKey[] = "about_sync_data"; | 51 const char kSyncDataKey[] = "about_sync_data"; |
| 52 const char kAppLauncherCategoryTag[] = "AppLauncher"; |
| 50 | 53 |
| 51 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
| 52 const char kHUDLogDataKey[] = "hud_log"; | 55 const char kHUDLogDataKey[] = "hud_log"; |
| 53 #endif | 56 #endif |
| 54 | 57 |
| 58 } // namespace |
| 59 |
| 55 namespace { | 60 namespace { |
| 56 | 61 |
| 57 const int kFeedbackVersion = 1; | 62 const int kFeedbackVersion = 1; |
| 58 | 63 |
| 59 const char kReportPhishingUrl[] = | 64 const char kReportPhishingUrl[] = |
| 60 "http://www.google.com/safebrowsing/report_phish/"; | 65 "http://www.google.com/safebrowsing/report_phish/"; |
| 61 | 66 |
| 62 // URL to post bug reports to. | 67 // URL to post bug reports to. |
| 63 const char kFeedbackPostUrl[] = | 68 const char kFeedbackPostUrl[] = |
| 64 "https://www.google.com/tools/feedback/chrome/__submit"; | 69 "https://www.google.com/tools/feedback/chrome/__submit"; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 355 |
| 351 // Set the screenshot object in feedback | 356 // Set the screenshot object in feedback |
| 352 *(feedback_data.mutable_screenshot()) = screenshot; | 357 *(feedback_data.mutable_screenshot()) = screenshot; |
| 353 } | 358 } |
| 354 | 359 |
| 355 #if defined(OS_CHROMEOS) | 360 #if defined(OS_CHROMEOS) |
| 356 if (data.sys_info()) { | 361 if (data.sys_info()) { |
| 357 // Add the product specific data | 362 // Add the product specific data |
| 358 for (chromeos::system::LogDictionaryType::const_iterator i = | 363 for (chromeos::system::LogDictionaryType::const_iterator i = |
| 359 data.sys_info()->begin(); i != data.sys_info()->end(); ++i) { | 364 data.sys_info()->begin(); i != data.sys_info()->end(); ++i) { |
| 360 if (i->first == kSyncDataKey || | 365 if (i->first == chrome::kSyncDataKey || |
| 361 i->first == kHUDLogDataKey || | 366 i->first == chrome::kHUDLogDataKey || |
| 362 ValidFeedbackSize(i->second)) { | 367 ValidFeedbackSize(i->second)) { |
| 363 AddFeedbackData(&feedback_data, i->first, i->second); | 368 AddFeedbackData(&feedback_data, i->first, i->second); |
| 364 } | 369 } |
| 365 } | 370 } |
| 366 | 371 |
| 367 // If we have zipped logs, add them here | 372 // If we have zipped logs, add them here |
| 368 if (data.zip_content()) { | 373 if (data.zip_content()) { |
| 369 userfeedback::ProductSpecificBinaryData attachment; | 374 userfeedback::ProductSpecificBinaryData attachment; |
| 370 attachment.set_mime_type(kBZip2MimeType); | 375 attachment.set_mime_type(kBZip2MimeType); |
| 371 attachment.set_name(kLogsAttachmentName); | 376 attachment.set_name(kLogsAttachmentName); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 if (screenshot_size == NULL) | 462 if (screenshot_size == NULL) |
| 458 screenshot_size = new gfx::Rect(); | 463 screenshot_size = new gfx::Rect(); |
| 459 return *screenshot_size; | 464 return *screenshot_size; |
| 460 } | 465 } |
| 461 | 466 |
| 462 // static | 467 // static |
| 463 void FeedbackUtil::SetScreenshotSize(const gfx::Rect& rect) { | 468 void FeedbackUtil::SetScreenshotSize(const gfx::Rect& rect) { |
| 464 gfx::Rect& screen_size = GetScreenshotSize(); | 469 gfx::Rect& screen_size = GetScreenshotSize(); |
| 465 screen_size = rect; | 470 screen_size = rect; |
| 466 } | 471 } |
| OLD | NEW |