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

Side by Side Diff: ash/common/system/locale/locale_notification_controller.h

Issue 2420753002: ash: Use mojo LocaleNotificationController interface. (Closed)
Patch Set: Uniquify callbacks Created 4 years, 2 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
OLDNEW
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 ASH_COMMON_SYSTEM_LOCALE_LOCALE_NOTIFICATION_CONTROLLER_H_ 5 #ifndef ASH_COMMON_SYSTEM_LOCALE_LOCALE_NOTIFICATION_CONTROLLER_H_
6 #define ASH_COMMON_SYSTEM_LOCALE_LOCALE_NOTIFICATION_CONTROLLER_H_ 6 #define ASH_COMMON_SYSTEM_LOCALE_LOCALE_NOTIFICATION_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ash/common/system/locale/locale_observer.h" 10 #include "ash/public/interfaces/locale.mojom.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "mojo/public/cpp/bindings/binding_set.h"
12 13
13 namespace ash { 14 namespace ash {
14 15
15 // Observes the locale change and creates rich notification for the change. 16 // Observes the locale change and creates rich notification for the change.
16 class LocaleNotificationController : public LocaleObserver { 17 class LocaleNotificationController
18 : public mojom::LocaleNotificationController {
17 public: 19 public:
18 LocaleNotificationController(); 20 LocaleNotificationController();
19 ~LocaleNotificationController() override; 21 ~LocaleNotificationController() override;
20 22
23 // Binds the mojom::LocaleNotificationController interface request to this
24 // object.
25 void BindRequest(mojom::LocaleNotificationControllerRequest request);
26
21 private: 27 private:
22 // Overridden from LocaleObserver. 28 // Overridden from mojom::LocaleNotificationController:
23 void OnLocaleChanged(LocaleObserver::Delegate* delegate, 29 void OnLocaleChanged(const std::string& cur_locale,
24 const std::string& cur_locale,
25 const std::string& from_locale, 30 const std::string& from_locale,
26 const std::string& to_locale) override; 31 const std::string& to_locale,
32 const OnLocaleChangedCallback& callback) override;
27 33
28 std::string cur_locale_; 34 std::string cur_locale_;
29 std::string from_locale_; 35 std::string from_locale_;
30 std::string to_locale_; 36 std::string to_locale_;
31 37
38 // Bindings for the LocaleNotificationController interface.
39 mojo::BindingSet<mojom::LocaleNotificationController> bindings_;
40
32 DISALLOW_COPY_AND_ASSIGN(LocaleNotificationController); 41 DISALLOW_COPY_AND_ASSIGN(LocaleNotificationController);
33 }; 42 };
34 43
35 } // namespace ash 44 } // namespace ash
36 45
37 #endif // ASH_COMMON_SYSTEM_LOCALE_LOCALE_NOTIFICATION_CONTROLLER_H_ 46 #endif // ASH_COMMON_SYSTEM_LOCALE_LOCALE_NOTIFICATION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/common/mojo_interface_factory.cc ('k') | ash/common/system/locale/locale_notification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698