OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "mojo/application/application_runner_chromium.h" | 7 #include "mojo/application/application_runner_chromium.h" |
8 #include "mojo/common/weak_binding_set.h" | 8 #include "mojo/common/binding_set.h" |
9 #include "mojo/public/c/system/main.h" | 9 #include "mojo/public/c/system/main.h" |
10 #include "mojo/public/cpp/application/application_delegate.h" | 10 #include "mojo/public/cpp/application/application_delegate.h" |
11 #include "mojo/public/cpp/application/application_impl.h" | 11 #include "mojo/public/cpp/application/application_impl.h" |
12 #include "mojo/services/notifications/public/interfaces/notifications.mojom.h" | 12 #include "mojo/services/notifications/public/interfaces/notifications.mojom.h" |
13 | 13 |
14 namespace examples { | 14 namespace examples { |
15 | 15 |
16 static const base::TimeDelta kDefaultMessageDelay = | 16 static const base::TimeDelta kDefaultMessageDelay = |
17 base::TimeDelta::FromMilliseconds(3000); | 17 base::TimeDelta::FromMilliseconds(3000); |
18 | 18 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 return notification_data; | 99 return notification_data; |
100 } | 100 } |
101 | 101 |
102 void PostDelayed(base::Closure closure) { | 102 void PostDelayed(base::Closure closure) { |
103 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, closure, | 103 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, closure, |
104 kDefaultMessageDelay); | 104 kDefaultMessageDelay); |
105 } | 105 } |
106 | 106 |
107 private: | 107 private: |
108 notifications::NotificationServicePtr notification_service_; | 108 notifications::NotificationServicePtr notification_service_; |
109 mojo::WeakBindingSet<notifications::NotificationClient> client_bindings_; | 109 mojo::BindingSet<notifications::NotificationClient> client_bindings_; |
110 notifications::NotificationPtr first_notification_; | 110 notifications::NotificationPtr first_notification_; |
111 notifications::NotificationPtr second_notification_; | 111 notifications::NotificationPtr second_notification_; |
112 notifications::NotificationPtr dismissed_notification_; | 112 notifications::NotificationPtr dismissed_notification_; |
113 notifications::NotificationPtr select_notification_; | 113 notifications::NotificationPtr select_notification_; |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(NotificationGeneratorDelegate); | 115 DISALLOW_COPY_AND_ASSIGN(NotificationGeneratorDelegate); |
116 }; | 116 }; |
117 | 117 |
118 } // namespace examples | 118 } // namespace examples |
119 | 119 |
120 MojoResult MojoMain(MojoHandle application_request) { | 120 MojoResult MojoMain(MojoHandle application_request) { |
121 mojo::ApplicationRunnerChromium runner( | 121 mojo::ApplicationRunnerChromium runner( |
122 new examples::NotificationGeneratorDelegate); | 122 new examples::NotificationGeneratorDelegate); |
123 return runner.Run(application_request); | 123 return runner.Run(application_request); |
124 } | 124 } |
OLD | NEW |