Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: content/browser/mojo/mojo_application_host.h

Issue 280003003: Add SetClient method implementation to InterfaceImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_
6 #define CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ 6 #define CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_
7 7
8 #include "base/process/process_handle.h" 8 #include "base/process/process_handle.h"
9 #include "mojo/common/channel_init.h" 9 #include "mojo/common/channel_init.h"
10 #include "mojo/embedder/scoped_platform_handle.h" 10 #include "mojo/embedder/scoped_platform_handle.h"
(...skipping 24 matching lines...) Expand all
35 bool did_activate() const { return did_activate_; } 35 bool did_activate() const { return did_activate_; }
36 36
37 mojo::ShellClient* shell_client() { 37 mojo::ShellClient* shell_client() {
38 DCHECK(shell_.get()); 38 DCHECK(shell_.get());
39 return shell_->client(); 39 return shell_->client();
40 } 40 }
41 41
42 private: 42 private:
43 class ShellImpl : public mojo::InterfaceImpl<mojo::Shell> { 43 class ShellImpl : public mojo::InterfaceImpl<mojo::Shell> {
44 public: 44 public:
45 ShellImpl() : client_(NULL) {}
46 mojo::ShellClient* client() { return client_; }
47
48 virtual void OnConnectionError() OVERRIDE { 45 virtual void OnConnectionError() OVERRIDE {
49 // TODO(darin): How should we handle this error? 46 // TODO(darin): How should we handle this error?
50 } 47 }
51 48
52 // mojo::Shell methods: 49 // mojo::Shell methods:
53 virtual void SetClient(mojo::ShellClient* client) OVERRIDE;
54 virtual void Connect(const mojo::String& url, 50 virtual void Connect(const mojo::String& url,
55 mojo::ScopedMessagePipeHandle handle) OVERRIDE; 51 mojo::ScopedMessagePipeHandle handle) OVERRIDE;
56 private:
57 mojo::ShellClient* client_;
58 }; 52 };
59 53
60 mojo::common::ChannelInit channel_init_; 54 mojo::common::ChannelInit channel_init_;
61 mojo::embedder::ScopedPlatformHandle client_handle_; 55 mojo::embedder::ScopedPlatformHandle client_handle_;
62 56
63 scoped_ptr<ShellImpl> shell_; 57 scoped_ptr<ShellImpl> shell_;
64 58
65 bool did_activate_; 59 bool did_activate_;
66 60
67 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost); 61 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost);
68 }; 62 };
69 63
70 } // namespace content 64 } // namespace content
71 65
72 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ 66 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc ('k') | content/browser/mojo/mojo_application_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698