| 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 #ifndef MOJO_SHELL_PUBLIC_CPP_SHELL_H_ | 5 #ifndef MOJO_SHELL_PUBLIC_CPP_SHELL_H_ |
| 6 #define MOJO_SHELL_PUBLIC_CPP_SHELL_H_ | 6 #define MOJO_SHELL_PUBLIC_CPP_SHELL_H_ |
| 7 | 7 |
| 8 #include "mojo/shell/public/cpp/connection.h" | 8 #include "mojo/shell/public/cpp/connection.h" |
| 9 #include "mojo/shell/public/interfaces/shell.mojom.h" | 9 #include "mojo/shell/public/interfaces/shell.mojom.h" |
| 10 #include "mojo/shell/public/interfaces/shell_client.mojom.h" | 10 #include "mojo/shell/public/interfaces/shell_client.mojom.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 explicit ConnectParams(const std::string& url); | 40 explicit ConnectParams(const std::string& url); |
| 41 ~ConnectParams(); | 41 ~ConnectParams(); |
| 42 | 42 |
| 43 const GURL& url() { return url_; } | 43 const GURL& url() { return url_; } |
| 44 shell::mojom::CapabilityFilterPtr TakeFilter() { | 44 shell::mojom::CapabilityFilterPtr TakeFilter() { |
| 45 return std::move(filter_); | 45 return std::move(filter_); |
| 46 } | 46 } |
| 47 void set_filter(shell::mojom::CapabilityFilterPtr filter) { | 47 void set_filter(shell::mojom::CapabilityFilterPtr filter) { |
| 48 filter_ = std::move(filter); | 48 filter_ = std::move(filter); |
| 49 } | 49 } |
| 50 void set_user_id(uint32_t user_id) { user_id_ = user_id; } |
| 51 uint32_t user_id() const { return user_id_; } |
| 50 | 52 |
| 51 private: | 53 private: |
| 52 GURL url_; | 54 GURL url_; |
| 53 shell::mojom::CapabilityFilterPtr filter_; | 55 shell::mojom::CapabilityFilterPtr filter_; |
| 56 uint32_t user_id_; |
| 54 | 57 |
| 55 DISALLOW_COPY_AND_ASSIGN(ConnectParams); | 58 DISALLOW_COPY_AND_ASSIGN(ConnectParams); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 // Requests a new connection to an application. Returns a pointer to the | 61 // Requests a new connection to an application. Returns a pointer to the |
| 59 // connection if the connection is permitted by this application's delegate, | 62 // connection if the connection is permitted by this application's delegate, |
| 60 // or nullptr otherwise. Caller takes ownership. | 63 // or nullptr otherwise. Caller takes ownership. |
| 61 virtual scoped_ptr<Connection> Connect(const std::string& url) = 0; | 64 virtual scoped_ptr<Connection> Connect(const std::string& url) = 0; |
| 62 virtual scoped_ptr<Connection> Connect(ConnectParams* params) = 0; | 65 virtual scoped_ptr<Connection> Connect(ConnectParams* params) = 0; |
| 63 | 66 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 83 | 86 |
| 84 // Create an object that can be used to refcount the lifetime of the | 87 // Create an object that can be used to refcount the lifetime of the |
| 85 // application. The returned object may be cloned, and when the refcount falls | 88 // application. The returned object may be cloned, and when the refcount falls |
| 86 // to zero Quit() is called. | 89 // to zero Quit() is called. |
| 87 virtual scoped_ptr<AppRefCount> CreateAppRefCount() = 0; | 90 virtual scoped_ptr<AppRefCount> CreateAppRefCount() = 0; |
| 88 }; | 91 }; |
| 89 | 92 |
| 90 } // namespace mojo | 93 } // namespace mojo |
| 91 | 94 |
| 92 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_H_ | 95 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_H_ |
| OLD | NEW |