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

Side by Side Diff: blimp/engine/session/blimp_engine_session.cc

Issue 2091023006: Adds EngineGeolocationFeature for Blimp Geolocation project. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 4 years, 4 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
« no previous file with comments | « blimp/engine/session/blimp_engine_session.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "blimp/engine/session/blimp_engine_session.h" 5 #include "blimp/engine/session/blimp_engine_session.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility>
8 9
9 #include "base/command_line.h" 10 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
11 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
13 #include "base/threading/thread_task_runner_handle.h" 14 #include "base/threading/thread_task_runner_handle.h"
14 #include "base/trace_event/trace_event.h" 15 #include "base/trace_event/trace_event.h"
15 #include "blimp/common/blob_cache/in_memory_blob_cache.h" 16 #include "blimp/common/blob_cache/in_memory_blob_cache.h"
16 #include "blimp/common/create_blimp_message.h" 17 #include "blimp/common/create_blimp_message.h"
17 #include "blimp/common/proto/tab_control.pb.h" 18 #include "blimp/common/proto/tab_control.pb.h"
(...skipping 15 matching lines...) Expand all
33 #include "blimp/net/blob_channel/helium_blob_sender_delegate.h" 34 #include "blimp/net/blob_channel/helium_blob_sender_delegate.h"
34 #include "blimp/net/browser_connection_handler.h" 35 #include "blimp/net/browser_connection_handler.h"
35 #include "blimp/net/common.h" 36 #include "blimp/net/common.h"
36 #include "blimp/net/engine_authentication_handler.h" 37 #include "blimp/net/engine_authentication_handler.h"
37 #include "blimp/net/engine_connection_manager.h" 38 #include "blimp/net/engine_connection_manager.h"
38 #include "blimp/net/null_blimp_message_processor.h" 39 #include "blimp/net/null_blimp_message_processor.h"
39 #include "blimp/net/tcp_engine_transport.h" 40 #include "blimp/net/tcp_engine_transport.h"
40 #include "blimp/net/thread_pipe_manager.h" 41 #include "blimp/net/thread_pipe_manager.h"
41 #include "content/public/browser/browser_context.h" 42 #include "content/public/browser/browser_context.h"
42 #include "content/public/browser/browser_thread.h" 43 #include "content/public/browser/browser_thread.h"
44 #include "content/public/browser/geolocation_delegate.h"
45 #include "content/public/browser/geolocation_provider.h"
43 #include "content/public/browser/navigation_controller.h" 46 #include "content/public/browser/navigation_controller.h"
44 #include "content/public/browser/navigation_entry.h" 47 #include "content/public/browser/navigation_entry.h"
45 #include "content/public/browser/render_view_host.h" 48 #include "content/public/browser/render_view_host.h"
46 #include "content/public/browser/render_widget_host.h" 49 #include "content/public/browser/render_widget_host.h"
47 #include "content/public/browser/render_widget_host_view.h" 50 #include "content/public/browser/render_widget_host_view.h"
48 #include "content/public/browser/web_contents.h" 51 #include "content/public/browser/web_contents.h"
49 #include "net/base/ip_address.h" 52 #include "net/base/ip_address.h"
50 #include "net/base/net_errors.h" 53 #include "net/base/net_errors.h"
51 #include "ui/aura/client/default_capture_client.h" 54 #include "ui/aura/client/default_capture_client.h"
52 #include "ui/aura/env.h" 55 #include "ui/aura/env.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 kDefaultScaleFactor, 234 kDefaultScaleFactor,
232 gfx::Size(kDefaultDisplayWidth, kDefaultDisplayHeight)); 235 gfx::Size(kDefaultDisplayWidth, kDefaultDisplayHeight));
233 render_widget_feature_.SetDelegate(kDummyTabId, this); 236 render_widget_feature_.SetDelegate(kDummyTabId, this);
234 237
235 std::unique_ptr<HeliumBlobSenderDelegate> helium_blob_delegate( 238 std::unique_ptr<HeliumBlobSenderDelegate> helium_blob_delegate(
236 new HeliumBlobSenderDelegate); 239 new HeliumBlobSenderDelegate);
237 blob_delegate_ = helium_blob_delegate.get(); 240 blob_delegate_ = helium_blob_delegate.get();
238 blob_channel_sender_ = base::WrapUnique( 241 blob_channel_sender_ = base::WrapUnique(
239 new BlobChannelSenderImpl(base::WrapUnique(new InMemoryBlobCache), 242 new BlobChannelSenderImpl(base::WrapUnique(new InMemoryBlobCache),
240 std::move(helium_blob_delegate))); 243 std::move(helium_blob_delegate)));
244
245 content::GeolocationProvider::SetGeolocationDelegate(
246 geolocation_feature_.CreateGeolocationDelegate());
241 } 247 }
242 248
243 BlimpEngineSession::~BlimpEngineSession() { 249 BlimpEngineSession::~BlimpEngineSession() {
244 render_widget_feature_.RemoveDelegate(kDummyTabId); 250 render_widget_feature_.RemoveDelegate(kDummyTabId);
245 251
246 window_tree_host_->GetInputMethod()->RemoveObserver(this); 252 window_tree_host_->GetInputMethod()->RemoveObserver(this);
247 253
248 // Ensure that all tabs are torn down first, since teardown will 254 // Ensure that all tabs are torn down first, since teardown will
249 // trigger RenderViewDeleted callbacks to their observers, which will in turn 255 // trigger RenderViewDeleted callbacks to their observers, which will in turn
250 // send messages to net_components_, which is already deleted due to the line 256 // send messages to net_components_, which is already deleted due to the line
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 &render_widget_feature_)); 323 &render_widget_feature_));
318 render_widget_feature_.set_input_message_sender( 324 render_widget_feature_.set_input_message_sender(
319 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput, 325 thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput,
320 &render_widget_feature_)); 326 &render_widget_feature_));
321 render_widget_feature_.set_compositor_message_sender( 327 render_widget_feature_.set_compositor_message_sender(
322 thread_pipe_manager_->RegisterFeature(BlimpMessage::kCompositor, 328 thread_pipe_manager_->RegisterFeature(BlimpMessage::kCompositor,
323 &render_widget_feature_)); 329 &render_widget_feature_));
324 render_widget_feature_.set_ime_message_sender( 330 render_widget_feature_.set_ime_message_sender(
325 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme, 331 thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme,
326 &render_widget_feature_)); 332 &render_widget_feature_));
333 geolocation_feature_.set_outgoing_message_processor(
334 thread_pipe_manager_->RegisterFeature(BlimpMessage::kGeolocation,
335 &geolocation_feature_));
327 blob_delegate_->set_outgoing_message_processor( 336 blob_delegate_->set_outgoing_message_processor(
328 thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel, 337 thread_pipe_manager_->RegisterFeature(BlimpMessage::kBlobChannel,
329 blob_delegate_)); 338 blob_delegate_));
330 339
331 // The Settings feature does not need an outgoing message processor, since we 340 // The Settings feature does not need an outgoing message processor, since we
332 // don't send any messages to the client right now. 341 // don't send any messages to the client right now.
333 thread_pipe_manager_->RegisterFeature(BlimpMessage::kSettings, 342 thread_pipe_manager_->RegisterFeature(BlimpMessage::kSettings,
334 &settings_feature_); 343 &settings_feature_);
335 } 344 }
336 345
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 parent->AddChild(content); 572 parent->AddChild(content);
564 content->Show(); 573 content->Show();
565 574
566 tab_ = base::WrapUnique(new Tab(std::move(new_contents), target_tab_id, 575 tab_ = base::WrapUnique(new Tab(std::move(new_contents), target_tab_id,
567 &render_widget_feature_, 576 &render_widget_feature_,
568 navigation_message_sender_.get())); 577 navigation_message_sender_.get()));
569 } 578 }
570 579
571 } // namespace engine 580 } // namespace engine
572 } // namespace blimp 581 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/engine/session/blimp_engine_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698