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 13 matching lines...) Expand all Loading... |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/chrome_version_info.h" | 25 #include "chrome/common/chrome_version_info.h" |
26 #include "content/public/browser/navigation_controller.h" | 26 #include "content/public/browser/navigation_controller.h" |
27 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
28 #include "content/public/common/url_fetcher.h" | 28 #include "content/public/common/url_fetcher.h" |
29 #include "content/public/common/url_fetcher_delegate.h" | 29 #include "content/public/common/url_fetcher_delegate.h" |
30 #include "googleurl/src/gurl.h" | 30 #include "googleurl/src/gurl.h" |
31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
32 #include "grit/locale_settings.h" | 32 #include "grit/locale_settings.h" |
33 #include "grit/theme_resources.h" | 33 #include "grit/theme_resources.h" |
| 34 #include "net/base/load_flags.h" |
34 #include "net/url_request/url_request_status.h" | 35 #include "net/url_request/url_request_status.h" |
35 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
36 #include "unicode/locid.h" | 37 #include "unicode/locid.h" |
37 | 38 |
38 #if defined(OS_CHROMEOS) | 39 #if defined(OS_CHROMEOS) |
39 #include "chrome/browser/chromeos/notifications/system_notification.h" | 40 #include "chrome/browser/chromeos/notifications/system_notification.h" |
40 #endif | 41 #endif |
41 | 42 |
42 using content::WebContents; | 43 using content::WebContents; |
43 | 44 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 HasSwitch(switches::kFeedbackServer)) | 194 HasSwitch(switches::kFeedbackServer)) |
194 post_url = GURL(CommandLine::ForCurrentProcess()-> | 195 post_url = GURL(CommandLine::ForCurrentProcess()-> |
195 GetSwitchValueASCII(switches::kFeedbackServer)); | 196 GetSwitchValueASCII(switches::kFeedbackServer)); |
196 else | 197 else |
197 post_url = GURL(kFeedbackPostUrl); | 198 post_url = GURL(kFeedbackPostUrl); |
198 | 199 |
199 content::URLFetcher* fetcher = content::URLFetcher::Create( | 200 content::URLFetcher* fetcher = content::URLFetcher::Create( |
200 post_url, content::URLFetcher::POST, | 201 post_url, content::URLFetcher::POST, |
201 new FeedbackUtil::PostCleanup(profile, post_body, previous_delay)); | 202 new FeedbackUtil::PostCleanup(profile, post_body, previous_delay)); |
202 fetcher->SetRequestContext(profile->GetRequestContext()); | 203 fetcher->SetRequestContext(profile->GetRequestContext()); |
203 | 204 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); |
204 fetcher->SetUploadData(std::string(kProtBufMimeType), *post_body); | 205 fetcher->SetUploadData(std::string(kProtBufMimeType), *post_body); |
205 fetcher->Start(); | 206 fetcher->Start(); |
206 } | 207 } |
207 | 208 |
208 | 209 |
209 // static | 210 // static |
210 void FeedbackUtil::AddFeedbackData( | 211 void FeedbackUtil::AddFeedbackData( |
211 userfeedback::ExtensionSubmit* feedback_data, | 212 userfeedback::ExtensionSubmit* feedback_data, |
212 const std::string& key, const std::string& value) { | 213 const std::string& key, const std::string& value) { |
213 // Don't bother with empty keys or values | 214 // Don't bother with empty keys or values |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 if (screenshot_size == NULL) | 413 if (screenshot_size == NULL) |
413 screenshot_size = new gfx::Rect(); | 414 screenshot_size = new gfx::Rect(); |
414 return *screenshot_size; | 415 return *screenshot_size; |
415 } | 416 } |
416 | 417 |
417 // static | 418 // static |
418 void FeedbackUtil::SetScreenshotSize(const gfx::Rect& rect) { | 419 void FeedbackUtil::SetScreenshotSize(const gfx::Rect& rect) { |
419 gfx::Rect& screen_size = GetScreenshotSize(); | 420 gfx::Rect& screen_size = GetScreenshotSize(); |
420 screen_size = rect; | 421 screen_size = rect; |
421 } | 422 } |
OLD | NEW |