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

Unified Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 375213002: net-internals: Fallback debug log store when non-native path is download target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/net_internals/net_internals_ui.cc
diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
index 6f2d627b27a622de7570ab1ff122ca9417f22af2..8a2bf1180524935cc4808c994f4340644d9daf77 100644
--- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
+++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
@@ -79,6 +79,7 @@
#include "ui/base/resource/resource_bundle.h"
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/file_manager/filesystem_api_util.h"
#include "chrome/browser/chromeos/login/users/user.h"
#include "chrome/browser/chromeos/net/onc_utils.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
@@ -245,6 +246,7 @@ void WriteDebugLogToFile(const StoreDebugLogsCallback& callback,
LOG(ERROR) <<
"Can't create debug log file: " << file_path.AsUTF8Unsafe() << ", " <<
"error: " << file->error_details();
+ callback.Run(file_path, false);
return;
}
chromeos::DBusThreadManager::Get()->GetDebugDaemonClient()->GetDebugLogs(
@@ -1532,9 +1534,12 @@ void NetInternalsMessageHandler::OnStoreDebugLogs(const base::ListValue* list) {
SendJavascriptCommand("receivedStoreDebugLogs",
new base::StringValue("Creating log file..."));
- const DownloadPrefs* const prefs =
- DownloadPrefs::FromBrowserContext(Profile::FromWebUI(web_ui()));
- StoreDebugLogs(prefs->DownloadPath(),
+ Profile* const profile = Profile::FromWebUI(web_ui());
+ const DownloadPrefs* const prefs = DownloadPrefs::FromBrowserContext(profile);
+ base::FilePath path = prefs->DownloadPath();
+ if (file_manager::util::IsUnderNonNativeLocalPath(profile, path))
+ path = prefs->GetDefaultDownloadDirectoryForProfile();
+ StoreDebugLogs(path,
base::Bind(&NetInternalsMessageHandler::OnStoreDebugLogsCompleted,
AsWeakPtr()));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698