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

Side by Side Diff: chrome/browser/chromeos/usb_mount_observer.cc

Issue 1238006: Adding new test for mount observer. Also changing the usb mounter to only rel... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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) 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_window.h" 8 #include "chrome/browser/browser_window.h"
9 #include "chrome/browser/dom_ui/filebrowse_ui.h" 9 #include "chrome/browser/dom_ui/filebrowse_ui.h"
10 #include "chrome/browser/tab_contents/tab_contents.h" 10 #include "chrome/browser/tab_contents/tab_contents.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (!disks[i].mount_path.empty()) { 69 if (!disks[i].mount_path.empty()) {
70 // Doing second search to see if the current disk has already 70 // Doing second search to see if the current disk has already
71 // been popped up due to its parent device being plugged in. 71 // been popped up due to its parent device being plugged in.
72 iter = FindBrowserForPath(disks[i].system_path); 72 iter = FindBrowserForPath(disks[i].system_path);
73 if (iter != browsers_.end()) { 73 if (iter != browsers_.end()) {
74 std::string url = kFilebrowseURLHash; 74 std::string url = kFilebrowseURLHash;
75 url += disks[i].mount_path; 75 url += disks[i].mount_path;
76 TabContents* tab = iter->browser->GetSelectedTabContents(); 76 TabContents* tab = iter->browser->GetSelectedTabContents();
77 tab->OpenURL(GURL(url), GURL(), CURRENT_TAB, 77 tab->OpenURL(GURL(url), GURL(), CURRENT_TAB,
78 PageTransition::LINK); 78 PageTransition::LINK);
79 tab->NavigateToPendingEntry(NavigationController::RELOAD);
79 iter->device_path = path; 80 iter->device_path = path;
80 iter->browser->Reload();
81 } else { 81 } else {
82 OpenFileBrowse(disks[i].mount_path, disks[i].device_path); 82 OpenFileBrowse(disks[i].mount_path, disks[i].device_path);
83 } 83 }
84 } 84 }
85 return; 85 return;
86 } 86 }
87 } 87 }
88 } 88 }
89 } else if (evt == chromeos::DEVICE_ADDED) { 89 } else if (evt == chromeos::DEVICE_ADDED) {
90 LOG(INFO) << "Got device added" << path; 90 LOG(INFO) << "Got device added" << path;
(...skipping 24 matching lines...) Expand all
115 NotificationType::BROWSER_CLOSED, 115 NotificationType::BROWSER_CLOSED,
116 Source<Browser>(i->browser)); 116 Source<Browser>(i->browser));
117 if (i->browser->window()) { 117 if (i->browser->window()) {
118 i->browser->window()->Close(); 118 i->browser->window()->Close();
119 } 119 }
120 browsers_.erase(i); 120 browsers_.erase(i);
121 } 121 }
122 } 122 }
123 123
124 } // namespace chromeos 124 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/mock_mount_library.cc ('k') | chrome/browser/chromeos/usb_mount_observer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698