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

Side by Side Diff: components/arc/ime/arc_ime_ipc_host_impl.cc

Issue 1635603002: Make use of CreateInterfacePtrAndBind() where appropriate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 4 years, 11 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 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 "components/arc/ime/arc_ime_ipc_host_impl.h" 5 #include "components/arc/ime/arc_ime_ipc_host_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "components/arc/arc_bridge_service.h" 9 #include "components/arc/arc_bridge_service.h"
10 #include "ui/base/ime/composition_text.h" 10 #include "ui/base/ime/composition_text.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 ArcBridgeService* bridge_service) 73 ArcBridgeService* bridge_service)
74 : binding_(this), delegate_(delegate), bridge_service_(bridge_service) { 74 : binding_(this), delegate_(delegate), bridge_service_(bridge_service) {
75 bridge_service_->AddObserver(this); 75 bridge_service_->AddObserver(this);
76 } 76 }
77 77
78 ArcImeIpcHostImpl::~ArcImeIpcHostImpl() { 78 ArcImeIpcHostImpl::~ArcImeIpcHostImpl() {
79 bridge_service_->RemoveObserver(this); 79 bridge_service_->RemoveObserver(this);
80 } 80 }
81 81
82 void ArcImeIpcHostImpl::OnImeInstanceReady() { 82 void ArcImeIpcHostImpl::OnImeInstanceReady() {
83 arc::ImeHostPtr host; 83 bridge_service_->ime_instance()->Init(binding_.CreateInterfacePtrAndBind());
84 binding_.Bind(mojo::GetProxy(&host));
85 bridge_service_->ime_instance()->Init(std::move(host));
86 } 84 }
87 85
88 void ArcImeIpcHostImpl::SendSetCompositionText( 86 void ArcImeIpcHostImpl::SendSetCompositionText(
89 const ui::CompositionText& composition) { 87 const ui::CompositionText& composition) {
90 ImeInstance* ime_instance = bridge_service_->ime_instance(); 88 ImeInstance* ime_instance = bridge_service_->ime_instance();
91 if (!ime_instance) { 89 if (!ime_instance) {
92 LOG(ERROR) << "ArcImeInstance method called before being ready."; 90 LOG(ERROR) << "ArcImeInstance method called before being ready.";
93 return; 91 return;
94 } 92 }
95 93
(...skipping 27 matching lines...) Expand all
123 121
124 void ArcImeIpcHostImpl::OnCursorRectChanged(arc::CursorRectPtr rect) { 122 void ArcImeIpcHostImpl::OnCursorRectChanged(arc::CursorRectPtr rect) {
125 delegate_->OnCursorRectChanged(gfx::Rect( 123 delegate_->OnCursorRectChanged(gfx::Rect(
126 rect->left, 124 rect->left,
127 rect->top, 125 rect->top,
128 rect->right - rect->left, 126 rect->right - rect->left,
129 rect->bottom - rect->top)); 127 rect->bottom - rect->top));
130 } 128 }
131 129
132 } // namespace arc 130 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/clipboard/arc_clipboard_bridge.cc ('k') | components/arc/power/arc_power_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698