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

Side by Side Diff: win8/metro_driver/chrome_app_view_ash.cc

Issue 310853003: Add IPC::ChannelProxy::Create() and IPC::SyncChannel::Create() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « tools/ipc_fuzzer/replay/replay_process.cc ('k') | win8/viewer/metro_viewer_process_host.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "win8/metro_driver/stdafx.h" 5 #include "win8/metro_driver/stdafx.h"
6 #include "win8/metro_driver/chrome_app_view_ash.h" 6 #include "win8/metro_driver/chrome_app_view_ash.h"
7 7
8 #include <corewindow.h> 8 #include <corewindow.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <windows.foundation.h> 10 #include <windows.foundation.h>
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 base::Thread::Options options; 687 base::Thread::Options options;
688 options.message_loop_type = base::MessageLoop::TYPE_IO; 688 options.message_loop_type = base::MessageLoop::TYPE_IO;
689 io_thread.StartWithOptions(options); 689 io_thread.StartWithOptions(options);
690 690
691 // Start up Chrome and wait for the desired IPC server connection to exist. 691 // Start up Chrome and wait for the desired IPC server connection to exist.
692 WaitForChromeIPCConnection(win8::kMetroViewerIPCChannelName); 692 WaitForChromeIPCConnection(win8::kMetroViewerIPCChannelName);
693 693
694 // In Aura mode we create an IPC channel to the browser, then ask it to 694 // In Aura mode we create an IPC channel to the browser, then ask it to
695 // connect to us. 695 // connect to us.
696 ChromeChannelListener ui_channel_listener(&ui_loop_, this); 696 ChromeChannelListener ui_channel_listener(&ui_loop_, this);
697 IPC::ChannelProxy ui_channel(win8::kMetroViewerIPCChannelName, 697 scoped_ptr<IPC::ChannelProxy> channel =
698 IPC::Channel::MODE_NAMED_CLIENT, 698 IPC::ChannelProxy::Create(win8::kMetroViewerIPCChannelName,
699 &ui_channel_listener, 699 IPC::Channel::MODE_NAMED_CLIENT,
700 io_thread.message_loop_proxy()); 700 &ui_channel_listener,
701 ui_channel_ = &ui_channel; 701 io_thread.message_loop_proxy());
702 ui_channel_ = channel.get();
702 703
703 // Upon receipt of the MetroViewerHostMsg_SetTargetSurface message the 704 // Upon receipt of the MetroViewerHostMsg_SetTargetSurface message the
704 // browser will use D3D from the browser process to present to our Window. 705 // browser will use D3D from the browser process to present to our Window.
705 ui_channel_->Send(new MetroViewerHostMsg_SetTargetSurface( 706 ui_channel_->Send(new MetroViewerHostMsg_SetTargetSurface(
706 gfx::NativeViewId(core_window_hwnd_), win32_dpi_scale_)); 707 gfx::NativeViewId(core_window_hwnd_), win32_dpi_scale_));
707 DVLOG(1) << "ICoreWindow sent " << core_window_hwnd_; 708 DVLOG(1) << "ICoreWindow sent " << core_window_hwnd_;
708 709
709 // Send an initial size message so that the Ash root window host gets sized 710 // Send an initial size message so that the Ash root window host gets sized
710 // correctly. 711 // correctly.
711 RECT rect = {0}; 712 RECT rect = {0};
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; 1390 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit;
1390 CheckHR(core_app.As(&app_exit)); 1391 CheckHR(core_app.As(&app_exit));
1391 globals.app_exit = app_exit.Detach(); 1392 globals.app_exit = app_exit.Detach();
1392 } 1393 }
1393 1394
1394 IFACEMETHODIMP 1395 IFACEMETHODIMP
1395 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { 1396 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) {
1396 *view = mswr::Make<ChromeAppViewAsh>().Detach(); 1397 *view = mswr::Make<ChromeAppViewAsh>().Detach();
1397 return (*view) ? S_OK : E_OUTOFMEMORY; 1398 return (*view) ? S_OK : E_OUTOFMEMORY;
1398 } 1399 }
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/replay/replay_process.cc ('k') | win8/viewer/metro_viewer_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698