-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17252 from brave/enable_sharing-desktop-screenshots
Enabled desktop screenshot feature by default
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 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
16 changes: 16 additions & 0 deletions
16
chromium_src/chrome/browser/sharing_hub/sharing_hub_features.cc
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,16 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "src/chrome/browser/sharing_hub/sharing_hub_features.cc" | ||
|
||
#include "base/feature_override.h" | ||
|
||
namespace sharing_hub { | ||
|
||
OVERRIDE_FEATURE_DEFAULT_STATES({{ | ||
{kDesktopScreenshots, base::FEATURE_ENABLED_BY_DEFAULT}, | ||
}}); | ||
|
||
} // namespace sharing_hub |
32 changes: 32 additions & 0 deletions
32
chromium_src/chrome/browser/ui/views/sharing_hub/screenshot/screenshot_captured_bubble.cc
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,32 @@ | ||
/* Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include <string> | ||
|
||
#include "base/strings/strcat.h" | ||
#include "base/strings/utf_string_conversions.h" | ||
#include "components/download/public/common/download_url_parameters.h" | ||
#include "url/gurl.h" | ||
|
||
namespace { | ||
|
||
std::u16string GetBraveFilenameForURL(const GURL& url) { | ||
if (!url.has_host() || url.HostIsIPAddress()) { | ||
return u"brave_screenshot.png"; | ||
} | ||
|
||
return base::ASCIIToUTF16( | ||
base::StrCat({"brave_screenshot_", url.host_piece(), ".png"})); | ||
} | ||
|
||
} // namespace | ||
|
||
#define set_suggested_name(...) \ | ||
set_suggested_name( \ | ||
GetBraveFilenameForURL(web_contents_->GetLastCommittedURL())) | ||
|
||
#include "src/chrome/browser/ui/views/sharing_hub/screenshot/screenshot_captured_bubble.cc" | ||
|
||
#undef set_suggested_name |