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

Side by Side Diff: chrome/browser/system_monitor/removable_device_notifications_window_win.cc

Issue 11297002: [Media Gallery] Added code to support mtp device media file system on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Fixed win compile error by implementing GetMTPStorageInfoFromDeviceId in TestStorageNotifi… Created 7 years, 11 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 "chrome/browser/system_monitor/removable_device_notifications_window_wi n.h" 5 #include "chrome/browser/system_monitor/removable_device_notifications_window_wi n.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <dbt.h> 8 #include <dbt.h>
9 #include <fileapi.h> 9 #include <fileapi.h>
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 return true; 126 return true;
127 } 127 }
128 128
129 uint64 RemovableDeviceNotificationsWindowWin::GetStorageSize( 129 uint64 RemovableDeviceNotificationsWindowWin::GetStorageSize(
130 const std::string& location) const { 130 const std::string& location) const {
131 NOTIMPLEMENTED(); 131 NOTIMPLEMENTED();
132 return 0ULL; 132 return 0ULL;
133 } 133 }
134 134
135 bool RemovableDeviceNotificationsWindowWin::GetMTPStorageInfoFromDeviceId(
136 const std::string& storage_device_id,
137 string16* device_location,
138 string16* storage_object_id) const {
139 MediaStorageUtil::Type type;
140 MediaStorageUtil::CrackDeviceId(storage_device_id, &type, NULL);
141 return ((type == MediaStorageUtil::MTP_OR_PTP) &&
142 portable_device_watcher_->GetMTPStorageInfoFromDeviceId(
143 storage_device_id, device_location, storage_object_id));
144 }
145
135 // static 146 // static
136 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProcThunk( 147 LRESULT CALLBACK RemovableDeviceNotificationsWindowWin::WndProcThunk(
137 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { 148 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) {
138 RemovableDeviceNotificationsWindowWin* msg_wnd = 149 RemovableDeviceNotificationsWindowWin* msg_wnd =
139 reinterpret_cast<RemovableDeviceNotificationsWindowWin*>( 150 reinterpret_cast<RemovableDeviceNotificationsWindowWin*>(
140 GetWindowLongPtr(hwnd, GWLP_USERDATA)); 151 GetWindowLongPtr(hwnd, GWLP_USERDATA));
141 if (msg_wnd) 152 if (msg_wnd)
142 return msg_wnd->WndProc(hwnd, message, wparam, lparam); 153 return msg_wnd->WndProc(hwnd, message, wparam, lparam);
143 return ::DefWindowProc(hwnd, message, wparam, lparam); 154 return ::DefWindowProc(hwnd, message, wparam, lparam);
144 } 155 }
(...skipping 27 matching lines...) Expand all
172 portable_device_watcher_->OnWindowMessage(event_type, data); 183 portable_device_watcher_->OnWindowMessage(event_type, data);
173 } 184 }
174 185
175 // static 186 // static
176 RemovableStorageNotifications* RemovableStorageNotifications::GetInstance() { 187 RemovableStorageNotifications* RemovableStorageNotifications::GetInstance() {
177 DCHECK(g_removable_device_notifications_window_win); 188 DCHECK(g_removable_device_notifications_window_win);
178 return g_removable_device_notifications_window_win; 189 return g_removable_device_notifications_window_win;
179 } 190 }
180 191
181 } // namespace chrome 192 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698