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

Side by Side Diff: blimp/client/core/blimp_client_context_impl.cc

Issue 2258563003: Added features to BlimpClientContext and BlimpContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ime_feature_move
Patch Set: Register features Created 4 years, 3 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 "blimp/client/core/blimp_client_context_impl.h" 5 #include "blimp/client/core/blimp_client_context_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/threading/sequenced_task_runner_handle.h" 10 #include "base/threading/sequenced_task_runner_handle.h"
11 #include "blimp/client/core/contents/blimp_contents_impl.h" 11 #include "blimp/client/core/contents/blimp_contents_impl.h"
12 #include "blimp/client/core/contents/blimp_contents_manager.h" 12 #include "blimp/client/core/contents/blimp_contents_manager.h"
13 #include "blimp/client/core/contents/ime_feature.h"
14 #include "blimp/client/core/contents/navigation_feature.h"
13 #include "blimp/client/core/contents/tab_control_feature.h" 15 #include "blimp/client/core/contents/tab_control_feature.h"
14 #include "blimp/client/core/session/cross_thread_network_event_observer.h" 16 #include "blimp/client/core/session/cross_thread_network_event_observer.h"
15 #include "blimp/client/public/blimp_client_context_delegate.h" 17 #include "blimp/client/public/blimp_client_context_delegate.h"
16 18
17 #if defined(OS_ANDROID) 19 #if defined(OS_ANDROID)
18 #include "blimp/client/core/android/blimp_client_context_impl_android.h" 20 #include "blimp/client/core/android/blimp_client_context_impl_android.h"
19 #endif // OS_ANDROID 21 #endif // OS_ANDROID
20 22
21 namespace blimp { 23 namespace blimp {
22 namespace client { 24 namespace client {
(...skipping 19 matching lines...) Expand all
42 file_thread_task_runner); 44 file_thread_task_runner);
43 #endif // defined(OS_ANDROID) 45 #endif // defined(OS_ANDROID)
44 } 46 }
45 47
46 BlimpClientContextImpl::BlimpClientContextImpl( 48 BlimpClientContextImpl::BlimpClientContextImpl(
47 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, 49 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner,
48 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner) 50 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner)
49 : BlimpClientContext(), 51 : BlimpClientContext(),
50 io_thread_task_runner_(io_thread_task_runner), 52 io_thread_task_runner_(io_thread_task_runner),
51 file_thread_task_runner_(file_thread_task_runner), 53 file_thread_task_runner_(file_thread_task_runner),
54 ime_feature_(new ImeFeature),
55 navigation_feature_(new NavigationFeature),
52 tab_control_feature_(new TabControlFeature), 56 tab_control_feature_(new TabControlFeature),
53 blimp_contents_manager_(new BlimpContentsManager( 57 blimp_contents_manager_(
54 tab_control_feature_.get())), 58 new BlimpContentsManager(ime_feature_.get(),
59 navigation_feature_.get(),
60 tab_control_feature_.get())),
55 weak_factory_(this) { 61 weak_factory_(this) {
56 net_components_.reset(new ClientNetworkComponents( 62 net_components_.reset(new ClientNetworkComponents(
57 base::MakeUnique<CrossThreadNetworkEventObserver>( 63 base::MakeUnique<CrossThreadNetworkEventObserver>(
58 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()))); 64 weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get())));
59 65
60 // The |thread_pipe_manager_| must be set up correctly before features are 66 // The |thread_pipe_manager_| must be set up correctly before features are
61 // registered. 67 // registered.
62 thread_pipe_manager_ = base::MakeUnique<ThreadPipeManager>( 68 thread_pipe_manager_ = base::MakeUnique<ThreadPipeManager>(
63 io_thread_task_runner_, net_components_->GetBrowserConnectionHandler()); 69 io_thread_task_runner_, net_components_->GetBrowserConnectionHandler());
64 70
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 147 }
142 148
143 io_thread_task_runner_->PostTask( 149 io_thread_task_runner_->PostTask(
144 FROM_HERE, 150 FROM_HERE,
145 base::Bind(&ClientNetworkComponents::ConnectWithAssignment, 151 base::Bind(&ClientNetworkComponents::ConnectWithAssignment,
146 base::Unretained(net_components_.get()), assignment)); 152 base::Unretained(net_components_.get()), assignment));
147 } 153 }
148 154
149 void BlimpClientContextImpl::RegisterFeatures() { 155 void BlimpClientContextImpl::RegisterFeatures() {
150 // Register features' message senders and receivers. 156 // Register features' message senders and receivers.
157 ime_feature_->set_outgoing_message_processor(
158 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme,
159 ime_feature_.get()));
160 navigation_feature_->set_outgoing_message_processor(
161 thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation,
162 navigation_feature_.get()));
151 tab_control_feature_->set_outgoing_message_processor( 163 tab_control_feature_->set_outgoing_message_processor(
152 thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl, 164 thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl,
153 tab_control_feature_.get())); 165 tab_control_feature_.get()));
154 } 166 }
155 167
156 } // namespace client 168 } // namespace client
157 } // namespace blimp 169 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/core/blimp_client_context_impl.h ('k') | blimp/client/core/contents/blimp_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698