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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 return false; | 233 return false; |
234 const size_t line_count = std::count(content.begin(), content.end(), '\n'); | 234 const size_t line_count = std::count(content.begin(), content.end(), '\n'); |
235 if (line_count > kFeedbackMaxLineCount) | 235 if (line_count > kFeedbackMaxLineCount) |
236 return false; | 236 return false; |
237 return true; | 237 return true; |
238 } | 238 } |
239 #endif | 239 #endif |
240 | 240 |
241 // static | 241 // static |
242 void FeedbackUtil::SendReport(scoped_refptr<FeedbackData> data) { | 242 void FeedbackUtil::SendReport(scoped_refptr<FeedbackData> data) { |
243 if (!data) { | 243 if (!data.get()) { |
244 LOG(ERROR) << "FeedbackUtil::SendReport called with NULL data!"; | 244 LOG(ERROR) << "FeedbackUtil::SendReport called with NULL data!"; |
245 NOTREACHED(); | 245 NOTREACHED(); |
246 return; | 246 return; |
247 } | 247 } |
248 | 248 |
249 // Create google feedback protocol buffer objects | 249 // Create google feedback protocol buffer objects |
250 userfeedback::ExtensionSubmit feedback_data; | 250 userfeedback::ExtensionSubmit feedback_data; |
251 // type id set to 0, unused field but needs to be initialized to 0 | 251 // type id set to 0, unused field but needs to be initialized to 0 |
252 feedback_data.set_type_id(0); | 252 feedback_data.set_type_id(0); |
253 | 253 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 if (screenshot_size == NULL) | 417 if (screenshot_size == NULL) |
418 screenshot_size = new gfx::Rect(); | 418 screenshot_size = new gfx::Rect(); |
419 return *screenshot_size; | 419 return *screenshot_size; |
420 } | 420 } |
421 | 421 |
422 // static | 422 // static |
423 void FeedbackUtil::SetScreenshotSize(const gfx::Rect& rect) { | 423 void FeedbackUtil::SetScreenshotSize(const gfx::Rect& rect) { |
424 gfx::Rect& screen_size = GetScreenshotSize(); | 424 gfx::Rect& screen_size = GetScreenshotSize(); |
425 screen_size = rect; | 425 screen_size = rect; |
426 } | 426 } |
OLD | NEW |