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

Side by Side Diff: ash/mus/keyboard_ui_mus.cc

Issue 2509853002: Convert //mash to define service names in mojom (Closed)
Patch Set: . Created 4 years, 1 month 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
« no previous file with comments | « ash/mus/app_list_presenter_mus.cc ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ash/mus/keyboard_ui_mus.h" 5 #include "ash/mus/keyboard_ui_mus.h"
6 6
7 #include "ash/common/keyboard/keyboard_ui_observer.h" 7 #include "ash/common/keyboard/keyboard_ui_observer.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "content/public/common/service_names.mojom.h"
9 #include "services/service_manager/public/cpp/connector.h" 10 #include "services/service_manager/public/cpp/connector.h"
10 11
11 namespace ash { 12 namespace ash {
12 13
13 KeyboardUIMus::KeyboardUIMus(service_manager::Connector* connector) 14 KeyboardUIMus::KeyboardUIMus(service_manager::Connector* connector)
14 : is_enabled_(false), observer_binding_(this) { 15 : is_enabled_(false), observer_binding_(this) {
15 if (connector) { 16 if (connector) {
16 // TODO(sky): should be something like mojo:keyboard, but need mapping. 17 // TODO(sky): should be something like mojo:keyboard, but need mapping.
17 connector->ConnectToInterface("content_browser", &keyboard_); 18 connector->ConnectToInterface(content::mojom::kBrowserServiceName,
19 &keyboard_);
18 keyboard_->AddObserver(observer_binding_.CreateInterfacePtrAndBind()); 20 keyboard_->AddObserver(observer_binding_.CreateInterfacePtrAndBind());
19 } 21 }
20 } 22 }
21 23
22 KeyboardUIMus::~KeyboardUIMus() {} 24 KeyboardUIMus::~KeyboardUIMus() {}
23 25
24 // static 26 // static
25 std::unique_ptr<KeyboardUI> KeyboardUIMus::Create( 27 std::unique_ptr<KeyboardUI> KeyboardUIMus::Create(
26 service_manager::Connector* connector) { 28 service_manager::Connector* connector) {
27 return base::MakeUnique<KeyboardUIMus>(connector); 29 return base::MakeUnique<KeyboardUIMus>(connector);
(...skipping 17 matching lines...) Expand all
45 const gfx::Rect& bounds) { 47 const gfx::Rect& bounds) {
46 if (is_enabled_ == is_enabled) 48 if (is_enabled_ == is_enabled)
47 return; 49 return;
48 50
49 is_enabled_ = is_enabled; 51 is_enabled_ = is_enabled;
50 for (auto& observer : *observers()) 52 for (auto& observer : *observers())
51 observer.OnKeyboardEnabledStateChanged(is_enabled); 53 observer.OnKeyboardEnabledStateChanged(is_enabled);
52 } 54 }
53 55
54 } // namespace ash 56 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/app_list_presenter_mus.cc ('k') | chrome/browser/chromeos/locale_change_guard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698