| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |