OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/usb_mount_observer.h" | 5 #include "chrome/browser/chromeos/usb_mount_observer.h" |
6 | 6 |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
9 #include "chrome/browser/browser_window.h" | 9 #include "chrome/browser/browser_window.h" |
10 #include "chrome/browser/dom_ui/filebrowse_ui.h" | 10 #include "chrome/browser/dom_ui/filebrowse_ui.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 if (Source<Browser>(source).ptr() == i->browser) { | 29 if (Source<Browser>(source).ptr() == i->browser) { |
30 i->browser = NULL; | 30 i->browser = NULL; |
31 registrar_.Remove(this, | 31 registrar_.Remove(this, |
32 NotificationType::BROWSER_CLOSED, | 32 NotificationType::BROWSER_CLOSED, |
33 source); | 33 source); |
34 return; | 34 return; |
35 } | 35 } |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
| 39 void USBMountObserver::ScanForDevices(chromeos::MountLibrary* obj) { |
| 40 const chromeos::MountLibrary::DiskVector& disks = obj->disks(); |
| 41 for (size_t i = 0; i < disks.size(); ++i) { |
| 42 chromeos::MountLibrary::Disk disk = disks[i]; |
| 43 if (!disk.is_parent && !disk.device_path.empty()) { |
| 44 obj->MountPath(disk.device_path.c_str()); |
| 45 } |
| 46 } |
| 47 } |
| 48 |
39 void USBMountObserver::OpenFileBrowse(const std::string& url, | 49 void USBMountObserver::OpenFileBrowse(const std::string& url, |
40 const std::string& device_path, | 50 const std::string& device_path, |
41 bool small) { | 51 bool small) { |
42 Browser* browser; | 52 Browser* browser; |
43 Profile* profile; | 53 Profile* profile; |
44 profile = BrowserList::GetLastActive()->profile(); | 54 profile = BrowserList::GetLastActive()->profile(); |
45 if (small) { | 55 if (small) { |
46 browser = FileBrowseUI::OpenPopup(profile, | 56 browser = FileBrowseUI::OpenPopup(profile, |
47 url, | 57 url, |
48 FileBrowseUI::kSmallPopupWidth, | 58 FileBrowseUI::kSmallPopupWidth, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 } | 176 } |
167 } | 177 } |
168 for (size_t x = 0; x < close_these.size(); x++) { | 178 for (size_t x = 0; x < close_these.size(); x++) { |
169 if (close_these[x]->window()) { | 179 if (close_these[x]->window()) { |
170 close_these[x]->window()->Close(); | 180 close_these[x]->window()->Close(); |
171 } | 181 } |
172 } | 182 } |
173 } | 183 } |
174 | 184 |
175 } // namespace chromeos | 185 } // namespace chromeos |
OLD | NEW |