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

Side by Side Diff: chrome/browser/extensions/file_manager_util.cc

Issue 7701015: Making BrowserNavigator open file browser singleton tab respecting URLs ref value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "Changing comments in browsertest" Created 9 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/browser.h » ('j') | chrome/browser/ui/browser.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/extensions/file_manager_util.h" 4 #include "chrome/browser/extensions/file_manager_util.h"
5 5
6 #include "base/json/json_writer.h" 6 #include "base/json/json_writer.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return; 203 return;
204 204
205 FilePath virtual_path; 205 FilePath virtual_path;
206 if (!FileManagerUtil::ConvertFileToRelativeFileSystemPath(browser->profile(), 206 if (!FileManagerUtil::ConvertFileToRelativeFileSystemPath(browser->profile(),
207 dir, 207 dir,
208 &virtual_path)) { 208 &virtual_path)) {
209 return; 209 return;
210 } 210 }
211 211
212 std::string url = chrome::kChromeUIFileManagerURL; 212 std::string url = chrome::kChromeUIFileManagerURL;
213 url += '#' + EscapeUrlEncodedData(virtual_path.value(), false); 213 url += "#/" + EscapeUrlEncodedData(virtual_path.value(), false);
214 214
215 UserMetrics::RecordAction(UserMetricsAction("ShowFileBrowserFullTab")); 215 UserMetrics::RecordAction(UserMetricsAction("ShowFileBrowserFullTab"));
216 browser->ShowSingletonTab(GURL(url)); 216 browser->ShowSingletonTabRespectRef(GURL(url));
217 } 217 }
218 218
219 void FileManagerUtil::ViewItem(const FilePath& full_path, bool enqueue) { 219 void FileManagerUtil::ViewItem(const FilePath& full_path, bool enqueue) {
220 std::string ext = full_path.Extension(); 220 std::string ext = full_path.Extension();
221 // For things supported natively by the browser, we should open it 221 // For things supported natively by the browser, we should open it
222 // in a tab. 222 // in a tab.
223 if (IsSupportedBrowserExtension(ext.data())) { 223 if (IsSupportedBrowserExtension(ext.data())) {
224 std::string path; 224 std::string path;
225 path = "file://"; 225 path = "file://";
226 path.append(EscapeUrlEncodedData(full_path.value(), false)); 226 path.append(EscapeUrlEncodedData(full_path.value(), false));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 case SelectFileDialog::SELECT_OPEN_MULTI_FILE: 291 case SelectFileDialog::SELECT_OPEN_MULTI_FILE:
292 type_str = "open-multi-file"; 292 type_str = "open-multi-file";
293 break; 293 break;
294 294
295 default: 295 default:
296 NOTREACHED(); 296 NOTREACHED();
297 } 297 }
298 298
299 return type_str; 299 return type_str;
300 } 300 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser.h » ('j') | chrome/browser/ui/browser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698