OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/extensions/file_browser_event_router.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 const chromeos::MountLibrary::Disk* disk) { | 137 const chromeos::MountLibrary::Disk* disk) { |
138 VLOG(1) << "Disk changed : " << disk->device_path(); | 138 VLOG(1) << "Disk changed : " << disk->device_path(); |
139 if (!disk->mount_path().empty()) { | 139 if (!disk->mount_path().empty()) { |
140 HideDeviceNotification(disk->system_path()); | 140 HideDeviceNotification(disk->system_path()); |
141 // Remember this mount point. | 141 // Remember this mount point. |
142 if (mounted_devices_.find(disk->device_path()) == mounted_devices_.end()) { | 142 if (mounted_devices_.find(disk->device_path()) == mounted_devices_.end()) { |
143 mounted_devices_.insert( | 143 mounted_devices_.insert( |
144 std::pair<std::string, std::string>(disk->device_path(), | 144 std::pair<std::string, std::string>(disk->device_path(), |
145 disk->mount_path())); | 145 disk->mount_path())); |
146 DispatchEvent(disk->mount_path()); | 146 DispatchEvent(disk->mount_path()); |
147 // TODO(zelidrag): Find better icon here. | 147 HideDeviceNotification(disk->system_path()); |
148 ShowDeviceNotification(disk->system_path(), IDR_PAGEINFO_INFO, | 148 FileManagerDialog::ShowFullTabUrl(profile_, disk->mount_path()); |
achuithb
2011/04/16 00:33:52
How does this compile? You're not including file_m
| |
149 l10n_util::GetStringUTF16(IDS_REMOVABLE_DEVICE_MOUNTED_MESSAGE)); | |
150 } | 149 } |
151 } | 150 } |
152 } | 151 } |
153 | 152 |
154 void ExtensionFileBrowserEventRouter::OnDeviceAdded( | 153 void ExtensionFileBrowserEventRouter::OnDeviceAdded( |
155 const std::string& device_path) { | 154 const std::string& device_path) { |
156 VLOG(1) << "Device added : " << device_path; | 155 VLOG(1) << "Device added : " << device_path; |
157 // TODO(zelidrag): Find better icon here. | 156 // TODO(zelidrag): Find better icon here. |
158 ShowDeviceNotification(device_path, IDR_PAGEINFO_INFO, | 157 ShowDeviceNotification(device_path, IDR_PAGEINFO_INFO, |
159 l10n_util::GetStringUTF16(IDS_REMOVABLE_DEVICE_SCANNING_MESSAGE)); | 158 l10n_util::GetStringUTF16(IDS_REMOVABLE_DEVICE_SCANNING_MESSAGE)); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 ++iter) { | 209 ++iter) { |
211 const std::string& notification_device_path = iter->first; | 210 const std::string& notification_device_path = iter->first; |
212 // Doing a sub string match so that we find if this new one is a subdevice | 211 // Doing a sub string match so that we find if this new one is a subdevice |
213 // of another already inserted device. | 212 // of another already inserted device. |
214 if (StartsWithASCII(system_path, notification_device_path, true)) { | 213 if (StartsWithASCII(system_path, notification_device_path, true)) { |
215 return iter; | 214 return iter; |
216 } | 215 } |
217 } | 216 } |
218 return notifications_.end(); | 217 return notifications_.end(); |
219 } | 218 } |
OLD | NEW |