Roll src/third_party/skia 2440fcd:4de8c3a
[chromium-blink-merge.git] / mojo / shell / connect_to_application_params.cc
blobbd0edc2313c7ece6ebe68ba05a97ca1f7e0f1e46
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 "mojo/shell/connect_to_application_params.h"
7 #include "mojo/shell/application_instance.h"
9 namespace mojo {
10 namespace shell {
12 ConnectToApplicationParams::ConnectToApplicationParams() {}
14 ConnectToApplicationParams::~ConnectToApplicationParams() {}
16 void ConnectToApplicationParams::SetSource(ApplicationInstance* source) {
17 if (!source) {
18 source_ = Identity();
19 return;
22 source_ = source->identity();
25 void ConnectToApplicationParams::SetTarget(const Identity& target) {
26 target_ = target;
27 target_url_request_ = URLRequest::New();
28 target_url_request_->url = target_.url().spec();
31 void ConnectToApplicationParams::SetTargetURL(const GURL& target_url) {
32 target_ = Identity(target_url, target_.qualifier(), target_.filter());
33 target_url_request_ = URLRequest::New();
34 target_url_request_->url = target_.url().spec();
37 void ConnectToApplicationParams::SetTargetURLRequest(URLRequestPtr request) {
38 Identity target = request ? Identity(GURL(request->url), target_.qualifier(),
39 target_.filter())
40 : Identity();
41 SetTargetURLRequest(request.Pass(), target);
44 void ConnectToApplicationParams::SetTargetURLRequest(URLRequestPtr request,
45 const Identity& target) {
46 target_url_request_ = request.Pass();
47 target_ = target;
50 } // namespace shell
51 } // namespace mojo