| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chromeos/login/ui/login_feedback.h" | 5 #include "chrome/browser/chromeos/login/ui/login_feedback.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 | 247 |
| 248 void LoginFeedback::EnsureFeedbackUI() { | 248 void LoginFeedback::EnsureFeedbackUI() { |
| 249 // Bail if any feedback app window is opened. | 249 // Bail if any feedback app window is opened. |
| 250 if (feedback_window_handler_->HasFeedbackAppWindow()) | 250 if (feedback_window_handler_->HasFeedbackAppWindow()) |
| 251 return; | 251 return; |
| 252 | 252 |
| 253 extensions::FeedbackPrivateAPI* api = | 253 extensions::FeedbackPrivateAPI* api = |
| 254 extensions::FeedbackPrivateAPI::GetFactoryInstance()->Get(profile_); | 254 extensions::FeedbackPrivateAPI::GetFactoryInstance()->Get(profile_); |
| 255 api->RequestFeedbackForFlow( | 255 api->RequestFeedbackForFlow( |
| 256 description_, "Login", GURL(), | 256 description_, "Login", std::string(), GURL(), |
| 257 extensions::api::feedback_private::FeedbackFlow::FEEDBACK_FLOW_LOGIN); | 257 extensions::api::feedback_private::FeedbackFlow::FEEDBACK_FLOW_LOGIN); |
| 258 | 258 |
| 259 // Make sure there is a feedback app window opened. | 259 // Make sure there is a feedback app window opened. |
| 260 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 260 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 261 FROM_HERE, | 261 FROM_HERE, |
| 262 base::Bind(&LoginFeedback::EnsureFeedbackUI, weak_factory_.GetWeakPtr()), | 262 base::Bind(&LoginFeedback::EnsureFeedbackUI, weak_factory_.GetWeakPtr()), |
| 263 base::TimeDelta::FromSeconds(1)); | 263 base::TimeDelta::FromSeconds(1)); |
| 264 } | 264 } |
| 265 | 265 |
| 266 void LoginFeedback::OnFeedbackFinished() { | 266 void LoginFeedback::OnFeedbackFinished() { |
| 267 if (!finished_callback_.is_null()) | 267 if (!finished_callback_.is_null()) |
| 268 finished_callback_.Run(); | 268 finished_callback_.Run(); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace chromeos | 271 } // namespace chromeos |
| OLD | NEW |