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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 *os_version = "unknown"; | 165 *os_version = "unknown"; |
166 #endif | 166 #endif |
167 } | 167 } |
168 | 168 |
169 // static | 169 // static |
170 void FeedbackUtil::DispatchFeedback(Profile* profile, | 170 void FeedbackUtil::DispatchFeedback(Profile* profile, |
171 std::string* post_body, | 171 std::string* post_body, |
172 int64 delay) { | 172 int64 delay) { |
173 DCHECK(post_body); | 173 DCHECK(post_body); |
174 | 174 |
175 MessageLoop::current()->PostDelayedTask( | 175 MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind( |
176 FROM_HERE, | 176 &FeedbackUtil::SendFeedback, profile, post_body, delay), delay); |
177 base::Bind(&FeedbackUtil::SendFeedback, profile, post_body, delay), | |
178 base::TimeDelta::FromMilliseconds(delay)); | |
179 } | 177 } |
180 | 178 |
181 // static | 179 // static |
182 void FeedbackUtil::SendFeedback(Profile* profile, | 180 void FeedbackUtil::SendFeedback(Profile* profile, |
183 std::string* post_body, | 181 std::string* post_body, |
184 int64 previous_delay) { | 182 int64 previous_delay) { |
185 DCHECK(post_body); | 183 DCHECK(post_body); |
186 | 184 |
187 GURL post_url; | 185 GURL post_url; |
188 if (CommandLine::ForCurrentProcess()-> | 186 if (CommandLine::ForCurrentProcess()-> |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 if (screenshot_size == NULL) | 402 if (screenshot_size == NULL) |
405 screenshot_size = new gfx::Rect(); | 403 screenshot_size = new gfx::Rect(); |
406 return *screenshot_size; | 404 return *screenshot_size; |
407 } | 405 } |
408 | 406 |
409 // static | 407 // static |
410 void FeedbackUtil::SetScreenshotSize(const gfx::Rect& rect) { | 408 void FeedbackUtil::SetScreenshotSize(const gfx::Rect& rect) { |
411 gfx::Rect& screen_size = GetScreenshotSize(); | 409 gfx::Rect& screen_size = GetScreenshotSize(); |
412 screen_size = rect; | 410 screen_size = rect; |
413 } | 411 } |
OLD | NEW |