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

Unified Diff: win8/metro_driver/chrome_app_view_ash.cc

Issue 11446078: Add suport for changing cursors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « win8/metro_driver/chrome_app_view_ash.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/chrome_app_view_ash.cc
===================================================================
--- win8/metro_driver/chrome_app_view_ash.cc (revision 171601)
+++ win8/metro_driver/chrome_app_view_ash.cc (working copy)
@@ -66,8 +66,16 @@
class ChromeChannelListener : public IPC::Listener {
public:
+ ChromeChannelListener(MessageLoop* ui_loop, ChromeAppViewAsh* app_view)
+ : ui_proxy_(ui_loop->message_loop_proxy()),
+ app_view_(app_view) {
+ }
+
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
- DVLOG(1) << "Received ipc message " << message.type();
+ IPC_BEGIN_MESSAGE_MAP(ChromeChannelListener, message)
+ IPC_MESSAGE_HANDLER(MetroViewerHostMsg_SetCursor, OnSetCursor)
+ IPC_MESSAGE_UNHANDLED(__debugbreak())
+ IPC_END_MESSAGE_MAP()
return true;
}
@@ -75,6 +83,17 @@
DVLOG(1) << "Channel error";
MetroExit();
}
+
+ private:
+ void OnSetCursor(int64 cursor) {
+ ui_proxy_->PostTask(FROM_HERE,
+ base::Bind(&ChromeAppViewAsh::OnSetCursor,
+ base::Unretained(app_view_),
+ reinterpret_cast<HCURSOR>(cursor)));
+ }
+
+ scoped_refptr<base::MessageLoopProxy> ui_proxy_;
+ ChromeAppViewAsh* app_view_;
};
bool WaitForChromeIPCConnection(const std::string& channel_name) {
@@ -315,7 +334,7 @@
// In Aura mode we create an IPC channel to the browser, then ask it to
// connect to us.
- ChromeChannelListener ui_channel_listener;
+ ChromeChannelListener ui_channel_listener(&msg_loop, this);
IPC::ChannelProxy ui_channel(ipc_channel_name,
IPC::Channel::MODE_NAMED_CLIENT,
&ui_channel_listener,
@@ -342,6 +361,10 @@
return S_OK;
}
+void ChromeAppViewAsh::OnSetCursor(HCURSOR cursor) {
+ ::SetCursor(HCURSOR(cursor));
ananta 2012/12/11 00:17:30 replace with cursor
+}
+
HRESULT ChromeAppViewAsh::OnActivate(
winapp::Core::ICoreApplicationView*,
winapp::Activation::IActivatedEventArgs* args) {
« no previous file with comments | « win8/metro_driver/chrome_app_view_ash.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698