| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 SHELL_CONTEXT_H_ | 5 #ifndef SHELL_CONTEXT_H_ |
| 6 #define SHELL_CONTEXT_H_ | 6 #define SHELL_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Resolve an URL relative to the CWD mojo_shell was invoked from. This is a | 45 // Resolve an URL relative to the CWD mojo_shell was invoked from. This is a |
| 46 // nop for everything but relative file URLs or URLs without a scheme. | 46 // nop for everything but relative file URLs or URLs without a scheme. |
| 47 GURL ResolveCommandLineURL(const std::string& path); | 47 GURL ResolveCommandLineURL(const std::string& path); |
| 48 | 48 |
| 49 // This must be called with a message loop set up for the current thread, | 49 // This must be called with a message loop set up for the current thread, |
| 50 // which must remain alive until after Shutdown() is called. Returns true on | 50 // which must remain alive until after Shutdown() is called. Returns true on |
| 51 // success. | 51 // success. |
| 52 bool Init(); | 52 bool Init(); |
| 53 | 53 |
| 54 // Like Init(), but specifies values for |mojo_shell_path()| and |
| 55 // |mojo_shell_child_path()| explicitly. |
| 56 bool InitWithPaths(const base::FilePath& shell_path, |
| 57 const base::FilePath& shell_child_path); |
| 58 |
| 54 // If Init() was called and succeeded, this must be called before destruction. | 59 // If Init() was called and succeeded, this must be called before destruction. |
| 55 void Shutdown(); | 60 void Shutdown(); |
| 56 | 61 |
| 57 void Run(const GURL& url); | 62 void Run(const GURL& url); |
| 58 | 63 |
| 59 ApplicationManager* application_manager() { return &application_manager_; } | 64 ApplicationManager* application_manager() { return &application_manager_; } |
| 60 URLResolver* url_resolver() { return &url_resolver_; } | 65 URLResolver* url_resolver() { return &url_resolver_; } |
| 61 | 66 |
| 62 // Available after Init(): | 67 // Available after Init(): |
| 63 // These are absolute paths. |mojo_shell_path()| is really the path of the | 68 // These are absolute paths. |mojo_shell_path()| is really the path of the |
| (...skipping 28 matching lines...) Expand all Loading... |
| 92 GURL shell_file_root_; | 97 GURL shell_file_root_; |
| 93 GURL command_line_cwd_; | 98 GURL command_line_cwd_; |
| 94 | 99 |
| 95 DISALLOW_COPY_AND_ASSIGN(Context); | 100 DISALLOW_COPY_AND_ASSIGN(Context); |
| 96 }; | 101 }; |
| 97 | 102 |
| 98 } // namespace shell | 103 } // namespace shell |
| 99 } // namespace mojo | 104 } // namespace mojo |
| 100 | 105 |
| 101 #endif // SHELL_CONTEXT_H_ | 106 #endif // SHELL_CONTEXT_H_ |
| OLD | NEW |