Commit e7256d38 authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

Use dynamic CroshExtensionURL for crostini terminal

Currently we hardcode crostini terminal to use the builtin crosh
location, whereas crosh can dynamically allow nassh and nassh-dev
apps to be used instead.

With some expected changes coming in crrev.com/c/1905039 to
have crosh use chrome://terminal, and other changes to gzip
content, it is useful to have terminal use the same URL that
is used for crosh.

Bug: 1023866
Change-Id: I7784b42171c73592acdd99d20ade6367c2afa3de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913283Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714797}
parent b847d053
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/crostini/crostini_terminal.h" #include "chrome/browser/chromeos/crostini/crostini_terminal.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h" #include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h"
#include "chrome/browser/ui/ash/window_properties.h" #include "chrome/browser/ui/ash/window_properties.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
...@@ -18,9 +19,10 @@ GURL GenerateVshInCroshUrl(Profile* profile, ...@@ -18,9 +19,10 @@ GURL GenerateVshInCroshUrl(Profile* profile,
const std::string& vm_name, const std::string& vm_name,
const std::string& container_name, const std::string& container_name,
const std::vector<std::string>& terminal_args) { const std::vector<std::string>& terminal_args) {
std::string vsh_crosh = base::StringPrintf( std::string vsh_crosh =
"chrome-extension://%s/html/crosh.html?command=vmshell", extensions::TerminalExtensionHelper::GetCroshExtensionURL(profile)
kCrostiniCroshBuiltinAppId); .spec() +
"?command=vmshell";
std::string vm_name_param = net::EscapeQueryParamValue( std::string vm_name_param = net::EscapeQueryParamValue(
base::StringPrintf("--vm_name=%s", vm_name.c_str()), false); base::StringPrintf("--vm_name=%s", vm_name.c_str()), false);
std::string container_name_param = net::EscapeQueryParamValue( std::string container_name_param = net::EscapeQueryParamValue(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment