Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / chrome / browser / media / router / create_session_request.cc
blobaf834919bb24536c62384a4e3da1532405538840
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/media/router/create_session_request.h"
7 #include "chrome/browser/media/router/media_source_helper.h"
9 using content::PresentationSessionInfo;
10 using content::PresentationError;
12 namespace media_router {
14 CreateSessionRequest::CreateSessionRequest(
15 const std::string& presentation_url,
16 const std::string& presentation_id,
17 const GURL& frame_url,
18 const PresentationSessionSuccessCallback& success_cb,
19 const PresentationSessionErrorCallback& error_cb)
20 : presentation_info_(presentation_url, presentation_id),
21 media_source_(presentation_url),
22 frame_url_(frame_url),
23 success_cb_(success_cb),
24 error_cb_(error_cb),
25 cb_invoked_(false) {
28 CreateSessionRequest::~CreateSessionRequest() {
31 void CreateSessionRequest::MaybeInvokeSuccessCallback() {
32 if (!cb_invoked_) {
33 success_cb_.Run(presentation_info_);
34 cb_invoked_ = true;
38 void CreateSessionRequest::MaybeInvokeErrorCallback(
39 const content::PresentationError& error) {
40 if (!cb_invoked_) {
41 error_cb_.Run(error);
42 cb_invoked_ = true;
46 } // namespace media_router