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

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

Issue 11096013: Add functionality to the Windows 8 notification display functionality to invoke a caller specified … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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
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.h" 6 #include "win8/metro_driver/chrome_app_view.h"
7 #include "win8/metro_driver/direct3d_helper.h" 7 #include "win8/metro_driver/direct3d_helper.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <windows.applicationModel.datatransfer.h> 10 #include <windows.applicationModel.datatransfer.h>
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 void FlipFrameWindows() { 512 void FlipFrameWindows() {
513 DVLOG(1) << __FUNCTION__; 513 DVLOG(1) << __FUNCTION__;
514 globals.appview_msg_loop->PostTask( 514 globals.appview_msg_loop->PostTask(
515 FROM_HERE, base::Bind(&FlipFrameWindowsInternal)); 515 FROM_HERE, base::Bind(&FlipFrameWindowsInternal));
516 } 516 }
517 517
518 extern "C" __declspec(dllexport) 518 extern "C" __declspec(dllexport)
519 void DisplayNotification(const char* origin_url, const char* icon_url, 519 void DisplayNotification(const char* origin_url, const char* icon_url,
520 const wchar_t* title, const wchar_t* body, 520 const wchar_t* title, const wchar_t* body,
521 const wchar_t* display_source, 521 const wchar_t* display_source,
522 const char* notification_id) { 522 const char* notification_id,
523 base::win::MetroNotificationClickedHandler handler,
524 const wchar_t* handler_context) {
523 // TODO(ananta) 525 // TODO(ananta)
524 // Needs implementation. 526 // Needs implementation.
525 DVLOG(1) << __FUNCTION__; 527 DVLOG(1) << __FUNCTION__;
526 528
527 ToastNotificationHandler::DesktopNotification notification(origin_url, 529 ToastNotificationHandler::DesktopNotification notification(origin_url,
528 icon_url, 530 icon_url,
529 title, 531 title,
530 body, 532 body,
531 display_source, 533 display_source,
532 notification_id); 534 notification_id,
535 handler,
536 handler_context);
533 globals.appview_msg_loop->PostTask( 537 globals.appview_msg_loop->PostTask(
534 FROM_HERE, base::Bind(&ChromeAppView::DisplayNotification, 538 FROM_HERE, base::Bind(&ChromeAppView::DisplayNotification,
535 globals.view, notification)); 539 globals.view, notification));
536 } 540 }
537 541
538 extern "C" __declspec(dllexport) 542 extern "C" __declspec(dllexport)
539 bool CancelNotification(const char* notification_id) { 543 bool CancelNotification(const char* notification_id) {
540 // TODO(ananta) 544 // TODO(ananta)
541 // Needs implementation. 545 // Needs implementation.
542 DVLOG(1) << __FUNCTION__; 546 DVLOG(1) << __FUNCTION__;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 840
837 // Announce our message loop to the world. 841 // Announce our message loop to the world.
838 globals.appview_msg_loop = msg_loop.message_loop_proxy(); 842 globals.appview_msg_loop = msg_loop.message_loop_proxy();
839 843
840 // The thread needs to out-live the ChannelProxy. 844 // The thread needs to out-live the ChannelProxy.
841 base::Thread thread("metro_IO_thread"); 845 base::Thread thread("metro_IO_thread");
842 base::Thread::Options options; 846 base::Thread::Options options;
843 options.message_loop_type = MessageLoop::TYPE_IO; 847 options.message_loop_type = MessageLoop::TYPE_IO;
844 thread.StartWithOptions(options); 848 thread.StartWithOptions(options);
845 849
850 // The viewer channel opened below only applies when we are launched as an
851 // AURA viewer process.
852 #if defined(USE_AURA)
846 ChromeChannelListener channel_listener; 853 ChromeChannelListener channel_listener;
847 IPC::ChannelProxy chan("viewer", IPC::Channel::MODE_NAMED_CLIENT, 854 IPC::ChannelProxy chan("viewer", IPC::Channel::MODE_NAMED_CLIENT,
848 &channel_listener, thread.message_loop_proxy()); 855 &channel_listener, thread.message_loop_proxy());
849 channel_listener.Init(&chan); 856 channel_listener.Init(&chan);
850 chan.Send(new MetroViewerHostMsg_SetTargetSurface( 857 chan.Send(new MetroViewerHostMsg_SetTargetSurface(
851 gfx::NativeViewId(globals.core_window))); 858 gfx::NativeViewId(globals.core_window)));
852 859
853 DVLOG(1) << "ICoreWindow sent " << globals.core_window; 860 DVLOG(1) << "ICoreWindow sent " << globals.core_window;
854 861 #endif
855 // And post the task that'll do the inner Metro message pumping to it. 862 // And post the task that'll do the inner Metro message pumping to it.
856 msg_loop.PostTask(FROM_HERE, base::Bind(&RunMessageLoop, dispatcher.Get())); 863 msg_loop.PostTask(FROM_HERE, base::Bind(&RunMessageLoop, dispatcher.Get()));
857 864
858 // Post the recurring task which checks for OSK activation in metro chrome. 865 // Post the recurring task which checks for OSK activation in metro chrome.
859 // Please refer to the comments in the CheckForOSKActivation function for why 866 // Please refer to the comments in the CheckForOSKActivation function for why
860 // this is needed. 867 // this is needed.
861 // TODO(ananta) 868 // TODO(ananta)
862 // Take this out when the documented OSK notifications start working. 869 // Take this out when the documented OSK notifications start working.
863 msg_loop.PostDelayedTask( 870 msg_loop.PostDelayedTask(
864 FROM_HERE, 871 FROM_HERE,
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 CheckHR(core_app.As(&app_exit)); 1252 CheckHR(core_app.As(&app_exit));
1246 globals.app_exit = app_exit.Detach(); 1253 globals.app_exit = app_exit.Detach();
1247 } 1254 }
1248 1255
1249 IFACEMETHODIMP 1256 IFACEMETHODIMP
1250 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { 1257 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) {
1251 globals.view = mswr::Make<ChromeAppView>().Detach(); 1258 globals.view = mswr::Make<ChromeAppView>().Detach();
1252 *view = globals.view; 1259 *view = globals.view;
1253 return (*view) ? S_OK : E_OUTOFMEMORY; 1260 return (*view) ? S_OK : E_OUTOFMEMORY;
1254 } 1261 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/status_icons/status_icon_win.cc ('k') | win8/metro_driver/toast_notification_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698