| 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()));
|
| }
|
|
|