forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[remoting host][win] Show prompt when fallback browser unknown or inc…
…orrect Per discussion offline, we are not going to support the case where the user changes the default browser to the URL forwarder on the settings app, so it's unlikely that the fallback browser settings will be missing or configured incorrectly, unless the user has uninstalled the fallback browser. This CL simply makes the app show a prompt telling the user to change the browser to something else and reconfigure the URL forwarder in that case. Screenshot: https://screenshot.googleplex.com/6fc6xvW32fP9ax5 Bug: b:183135000 Change-Id: I72f0c908e9e45f1322296ebf4b6587d405b43526 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3139553 Commit-Queue: Yuwei Huang <yuweih@chromium.org> Reviewed-by: Joe Downing <joedow@chromium.org> Cr-Commit-Position: refs/heads/main@{#917933}
- Loading branch information
Showing
14 changed files
with
119 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2021 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "remoting/host/win/default_apps_util.h" | ||
|
||
#include <shobjidl.h> | ||
#include <wrl/client.h> | ||
|
||
#include "base/logging.h" | ||
|
||
namespace remoting { | ||
|
||
// The appModelId looks arbitrary but it is the same in Win8 and Win10. There is | ||
// no easy way to retrieve the appModelId from the registry. | ||
bool LaunchDefaultAppsSettingsModernDialog() { | ||
static const wchar_t kControlPanelAppModelId[] = | ||
L"windows.immersivecontrolpanel_cw5n1h2txyewy" | ||
L"!microsoft.windows.immersivecontrolpanel"; | ||
|
||
Microsoft::WRL::ComPtr<IApplicationActivationManager> activator; | ||
HRESULT hr = ::CoCreateInstance(CLSID_ApplicationActivationManager, nullptr, | ||
CLSCTX_ALL, IID_PPV_ARGS(&activator)); | ||
if (FAILED(hr)) { | ||
LOG(ERROR) << "Failed to create IApplicationActivationManager: " | ||
<< logging::SystemErrorCodeToString(hr); | ||
return false; | ||
} | ||
DWORD pid = 0; | ||
CoAllowSetForegroundWindow(activator.Get(), nullptr); | ||
hr = activator->ActivateApplication( | ||
kControlPanelAppModelId, L"page=SettingsPageAppsDefaults", AO_NONE, &pid); | ||
if (FAILED(hr)) { | ||
LOG(ERROR) << "Failed to activate application: " | ||
<< logging::SystemErrorCodeToString(hr); | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
} // namespace remoting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2021 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef REMOTING_HOST_WIN_DEFAULT_APPS_UTIL_H_ | ||
#define REMOTING_HOST_WIN_DEFAULT_APPS_UTIL_H_ | ||
|
||
namespace remoting { | ||
|
||
// Launches the Windows 'settings' modern app with the 'default apps' view | ||
// focused. This only works for Windows 8 and Windows 10. | ||
// Returns a boolean indicating whether the default apps view is successfully | ||
// launched. | ||
bool LaunchDefaultAppsSettingsModernDialog(); | ||
|
||
} // namespace remoting | ||
|
||
#endif // REMOTING_HOST_WIN_DEFAULT_APPS_UTIL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
remoting/resources/remoting_strings_grd/IDS_URL_FORWARDER_INCORRECTLY_CONFIGURED.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
658450bb1e1608cfa439f67f136cb6ef20ec5ca1 |