Skip to content

Merge master for 0.53.2 release #314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Aug 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
da8b0a0
Fix BraveAutocompleteController undefined reference error on debug build
simonhong Aug 1, 2018
723ce1c
Fix undefined brave::GetChannelImpl when builds vr_common shared lib
simonhong Aug 1, 2018
97140c1
Merge pull request #304 from brave/fix_linux_build_error
bbondy Aug 1, 2018
9b2a5ce
Add missing requirements to Linux zip
mbacchi Aug 1, 2018
839f59f
Native ledger 3rd party libs DEPS update
SergeyZhukovsky Aug 1, 2018
65f4b9f
Merge pull request #306 from brave/native_ledger_deps
bbondy Aug 1, 2018
271d4fd
Fix build with latest bat-native-tweetnacl
RyanJarv Aug 2, 2018
8d5ce2e
Merge pull request #307 from brave/fix/build-tweetnacl
bbondy Aug 2, 2018
dc1e224
Merge pull request #305 from brave/zips
mbacchi Aug 2, 2018
ec8267d
Enable granular control of autoplay by following steps
darkdh Jun 18, 2018
b084aa6
Default allow autoplay from local file
darkdh Jul 6, 2018
47e8d03
Add browser test
darkdh Jul 6, 2018
07678b6
Add unit test
darkdh Jul 10, 2018
b4842cc
Subclass PermissionManager
darkdh Jul 17, 2018
faadd75
EnableAutoplayMutedVideos(false) without patch and add browser test for
darkdh Jul 17, 2018
f0e40d0
GetEffectiveAutoplayPolicy overrides and remove unnecessary patch
darkdh Jul 18, 2018
5c56000
Filter out autoplay from kContentSettingsTypeGroupNames
darkdh Jul 27, 2018
cff4a62
permission_util.cc overrides
darkdh Jul 31, 2018
1b48534
Remove blink permission request patch
darkdh Jul 31, 2018
d6832e9
overrides anonymous namespace function
darkdh Jul 31, 2018
8cdd6dc
Use BraveInit() to unregister and register the default registry value
darkdh Aug 1, 2018
ce8109a
permission_uma_util patch removal
darkdh Aug 1, 2018
184f8e3
PermissionRequestImpl::GetMessageTextFragment and PermissionRequestIm…
darkdh Aug 1, 2018
0aaaf51
BraveAutoplayBlockedImageModel & BraveAutoplayContentSettingBubbleModel
darkdh Aug 3, 2018
cdbb29c
C69 patch rebase
darkdh Aug 4, 2018
95d25a5
let each component handle its own transpiling
bridiver Aug 4, 2018
ab75711
Merge pull request #309 from brave/component_resources
bbondy Aug 5, 2018
3d3e4b6
C69 rebase changes
darkdh Aug 5, 2018
34fc976
Harden AutoplayPermissionContextBrowserTest
darkdh Aug 5, 2018
9b2000c
Expose chrome.braveShields to brave-extension only
bbondy Aug 6, 2018
8a10c98
Test that only brave-extension has access to chrome.braveShields
bbondy Aug 6, 2018
7754a95
Merge pull request #312 from brave/disable-chrome-braveShields
bbondy Aug 6, 2018
9eb5e14
Subclass PermissionManagerFactory
darkdh Aug 7, 2018
09feca1
lint fix
darkdh Aug 7, 2018
409515d
Merge pull request #222 from brave/autoplay-rebase
darkdh Aug 7, 2018
ff40756
Revert "let each component handle its own transpiling"
bbondy Aug 7, 2018
c3d0cb0
Merge pull request #313 from brave/revert-309-component_resources
bbondy Aug 7, 2018
1c7e846
Use different BRANDING files for each channel on MacOS
simonhong Jul 30, 2018
72e5e4f
Consider multiple bundle id for signing on MacOS
simonhong Jul 31, 2018
15d5a3b
Make product name visible to users
simonhong Jul 31, 2018
415627e
Override chrome_constants.cc and remove its patch
simonhong Aug 1, 2018
9569752
Add simple test for changes in chrome_constants.cc
simonhong Aug 1, 2018
8dc0b85
Add newly added constants to chrome_constants.cc
simonhong Aug 1, 2018
061c53b
Add empty MAC_TEAM_ID to BRANDING files
simonhong Aug 8, 2018
1b5fd09
Merge pull request #298 from brave/multi_channel_install_on_mac
bbondy Aug 8, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import("//build/config/locales.gni")
import("//build/util/process_version.gni")
import("//media/cdm/library_cdm/cdm_paths.gni")
import("//brave/brave_paks.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")

if (is_mac) {
import("//build/config/mac/rules.gni")
Expand Down Expand Up @@ -175,23 +176,40 @@ process_version("generate_version") {
copy("brave_dist_resources") {
sources = [ "$root_out_dir/version" ]

if (!is_mac) {
sources += [
"$root_out_dir/brave_resources.pak",
"$root_out_dir/brave_100_percent.pak",
"$root_out_dir/brave_200_percent.pak",
"$root_out_dir/$brave_exe"
]
}

deps = [
":brave",
":generate_version",
":brave_license_dist_resources",
":packed_resources",
"build/$target_os:brave",
"//third_party/icu:icudata",
]

if (!is_mac) {
sources += [
"$root_out_dir/brave_resources.pak",
"$root_out_dir/brave_100_percent.pak",
"$root_out_dir/brave_200_percent.pak",
"$root_out_dir/$brave_exe",
"$root_out_dir/chrome_100_percent.pak",
"$root_out_dir/chrome_200_percent.pak",
"$root_out_dir/icudtl.dat",
"$root_out_dir/resources.pak",
]

if (v8_use_external_startup_data) {
sources += [ "$root_out_dir/natives_blob.bin" ]
deps += [ "//v8" ]

if (use_v8_context_snapshot) {
sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
deps += [ "//tools/v8_context_snapshot" ]
} else {
sources += [ "$root_out_dir/snapshot_blob.bin" ]
}
}
}

outputs = [
"$brave_dist_dir/{{source_file_part}}"
]
Expand Down
8 changes: 4 additions & 4 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ deps = {
"vendor/python-patch": "https://github.com/svn2github/python-patch@a336a458016ced89aba90dfc3f4c8222ae3b1403",
"vendor/sparkle": "https://github.com/brave/Sparkle.git@c0759cce415d7c0feae45005c8a013b1898711f0",
"vendor/bat-native-ledger": "https://github.com/brave-intl/bat-native-ledger@a3e64797bf6ebbfa39a60240db8d82995f97ebd9",
"vendor/bat-native-rapidjson": "https://github.com/brave-intl/bat-native-rapidjson.git@744b43313525a047eda4f2e2e689aa88b6c596fa",
"vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@e5aba371a56d3e41f7e80e868312446ce7bd434c",
"vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@8f60c03329f475959b44cd22838284e19508ec80",
"vendor/bat-native-tweetnacl": "https://github.com/brave-intl/bat-native-tweetnacl.git@d61f0cdc88dd2c4320176d2c514b8dd8dd1f22c2",
"vendor/bat-native-rapidjson": "https://github.com/brave-intl/bat-native-rapidjson.git@86aafe2ef89835ae71c9ed7c2527e3bb3000930e",
"vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@9b119931c702d55be994117eb505d56310720b1d",
"vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@6f5817c5a4dcabb49e22b578ecae4993159e6481",
"vendor/bat-native-tweetnacl": "https://github.com/brave-intl/bat-native-tweetnacl.git@05ed8f82faa03609fe5ae0a4c2d454afbe2ff267",
}

hooks = [
Expand Down
22 changes: 22 additions & 0 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,28 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
<message name="IDS_BOOKMARK_GROUP_FROM_BRAVE" desc="The group name of bookmarks from Brave">
Imported From Brave
</message>
<!-- Autoplay -->
<message name="IDS_AUTOPLAY_PERMISSION_FRAGMENT" desc="Permission request shown if the user is visiting a site that wants to autoplay media. Follows a prompt: 'This site would like to:'">
Autoplay media
</message>
<message name="IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY" desc="Label for autoplay site settings.">
Autoplay
</message>
<message name="IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_ASK" desc="The ask label for autoplay in site settings.">
Ask when a site wants to autoplay media
</message>
<message name="IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_ASK_RECOMMENDED" desc="The ask label for autoplay in site settings (with the 'recommended' suffix).">
Ask when a site wants to autoplay media (recommended)
</message>
<message name="IDS_BLOCKED_AUTOPLAY_TITLE" desc="Tooltip and bubble info header text when a page is not allowed to autoplay media.">
Autoplay was blocked on this page
</message>
<message name="IDS_BLOCKED_AUTOPLAY_UNBLOCK" desc="Radio button choice to unblock a site from autoplay media, displayed in bubble when a page tries to autoplay media.">
Always allow autoplay on <ph name="HOST">$1<ex>mail.google.com</ex></ph>
</message>
<message name="IDS_BLOCKED_AUTOPLAY_NO_ACTION" desc="Radio button choice to continue blocking a site from autoplay media, displayed in bubble when a page tries to autoplay media.">
Continue blocking autoplay
</message>
</messages>
<includes>
<include name="IDR_BRAVE_TAG_SERVICES_POLYFILL" file="resources/js/tag_services_polyfill.js" type="BINDATA" />
Expand Down
3 changes: 2 additions & 1 deletion app/theme/brave/BRANDING
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
COMPANY_FULLNAME=Brave Software, Inc.
COMPANY_SHORTNAME=Brave Software
PRODUCT_FULLNAME=Brave
PRODUCT_FULLNAME=Brave-Browser
PRODUCT_SHORTNAME=Brave
PRODUCT_INSTALLER_FULLNAME=Brave Installer
PRODUCT_INSTALLER_SHORTNAME=Brave Installer
COPYRIGHT=Copyright 2016 The Brave Authors. All rights reserved.
MAC_BUNDLE_ID=org.brave.Brave
MAC_CREATOR_CODE=Cr24
MAC_TEAM_ID=
10 changes: 10 additions & 0 deletions app/theme/brave/BRANDING.beta
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
COMPANY_FULLNAME=Brave Software, Inc.
COMPANY_SHORTNAME=Brave Software
PRODUCT_FULLNAME=Brave-Browser-Beta
PRODUCT_SHORTNAME=Brave
PRODUCT_INSTALLER_FULLNAME=Brave Installer
PRODUCT_INSTALLER_SHORTNAME=Brave Installer
COPYRIGHT=Copyright 2016 The Brave Authors. All rights reserved.
MAC_BUNDLE_ID=org.brave.Brave.beta
MAC_CREATOR_CODE=Cr24
MAC_TEAM_ID=
10 changes: 10 additions & 0 deletions app/theme/brave/BRANDING.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
COMPANY_FULLNAME=Brave Software, Inc.
COMPANY_SHORTNAME=Brave Software
PRODUCT_FULLNAME=Brave-Browser-Dev
PRODUCT_SHORTNAME=Brave
PRODUCT_INSTALLER_FULLNAME=Brave Installer
PRODUCT_INSTALLER_SHORTNAME=Brave Installer
COPYRIGHT=Copyright 2016 The Brave Authors. All rights reserved.
MAC_BUNDLE_ID=org.brave.Brave.dev
MAC_CREATOR_CODE=Cr24
MAC_TEAM_ID=
10 changes: 10 additions & 0 deletions app/theme/brave/BRANDING.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
COMPANY_FULLNAME=Brave Software, Inc.
COMPANY_SHORTNAME=Brave Software
PRODUCT_FULLNAME=Brave-Browser-Development
PRODUCT_SHORTNAME=Brave
PRODUCT_INSTALLER_FULLNAME=Brave Installer
PRODUCT_INSTALLER_SHORTNAME=Brave Installer
COPYRIGHT=Copyright 2016 The Brave Authors. All rights reserved.
MAC_BUNDLE_ID=org.brave.Brave.development
MAC_CREATOR_CODE=Cr24
MAC_TEAM_ID=
10 changes: 10 additions & 0 deletions app/theme/brave/BRANDING.nightly
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
COMPANY_FULLNAME=Brave Software, Inc.
COMPANY_SHORTNAME=Brave Software
PRODUCT_FULLNAME=Brave-Browser-Nightly
PRODUCT_SHORTNAME=Brave
PRODUCT_INSTALLER_FULLNAME=Brave Installer
PRODUCT_INSTALLER_SHORTNAME=Brave Installer
COPYRIGHT=Copyright 2016 The Brave Authors. All rights reserved.
MAC_BUNDLE_ID=org.brave.Brave.nightly
MAC_CREATOR_CODE=Cr24
MAC_TEAM_ID=
3 changes: 2 additions & 1 deletion browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ source_set("browser") {
]

deps = [
"autoplay",
"//brave/components/brave_shields/browser:brave_shields",
"//brave/components/omnibox/browser:brave_autocomplete",
"extensions",
"net",
"permissions",
]

if (is_mac) {
Expand Down
12 changes: 12 additions & 0 deletions browser/autoplay/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import("//build/config/features.gni")

source_set("autoplay") {
sources = [
"autoplay_permission_context.cc",
"autoplay_permission_context.h",
]

deps = [
"//chrome/browser",
]
}
58 changes: 58 additions & 0 deletions browser/autoplay/autoplay_permission_context.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* 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 http://mozilla.org/MPL/2.0/. */

#include "brave/browser/autoplay/autoplay_permission_context.h"

#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/permissions/permission_request_id.h"
#include "chrome/common/chrome_features.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "third_party/blink/public/mojom/feature_policy/feature_policy.mojom.h"

AutoplayPermissionContext::AutoplayPermissionContext(Profile* profile)
: PermissionContextBase(
profile,
CONTENT_SETTINGS_TYPE_AUTOPLAY,
blink::mojom::FeaturePolicyFeature::kAutoplay) {}

AutoplayPermissionContext::~AutoplayPermissionContext() = default;

void AutoplayPermissionContext::UpdateTabContext(
const PermissionRequestID& id,
const GURL& requesting_frame,
bool allowed) {
TabSpecificContentSettings* content_settings =
TabSpecificContentSettings::GetForFrame(id.render_process_id(),
id.render_frame_id());
if (!content_settings)
return;

if (!allowed) {
content_settings->OnContentBlocked(CONTENT_SETTINGS_TYPE_AUTOPLAY);
}
}

void AutoplayPermissionContext::NotifyPermissionSet(
const PermissionRequestID& id,
const GURL& requesting_origin,
const GURL& embedding_origin,
const BrowserPermissionCallback& callback,
bool persist,
ContentSetting content_setting) {
PermissionContextBase::NotifyPermissionSet(id, requesting_origin,
embedding_origin, callback,
persist, content_setting);
// Ask -> Allow
if (persist && content_setting == CONTENT_SETTING_ALLOW) {
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(
content::RenderFrameHost::FromID(id.render_process_id(),
id.render_frame_id()));
web_contents->GetController().Reload(content::ReloadType::NORMAL, false);
}
}

bool AutoplayPermissionContext::IsRestrictedToSecureOrigins() const {
return false;
}
32 changes: 32 additions & 0 deletions browser/autoplay/autoplay_permission_context.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* 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 http://mozilla.org/MPL/2.0/. */

#ifndef BRAVE_BROWSER_AUTOPLAY_AUTOPLAY_PERMISSION_CONTEXT_H_
#define BRAVE_BROWSER_AUTOPLAY_AUTOPLAY_PERMISSION_CONTEXT_H_

#include "base/macros.h"
#include "chrome/browser/permissions/permission_context_base.h"

class AutoplayPermissionContext : public PermissionContextBase {
public:
explicit AutoplayPermissionContext(Profile* profile);
~AutoplayPermissionContext() override;

private:
// PermissionContextBase:
void UpdateTabContext(const PermissionRequestID& id,
const GURL& requesting_frame,
bool allowed) override;
void NotifyPermissionSet(const PermissionRequestID& id,
const GURL& requesting_origin,
const GURL& embedding_origin,
const BrowserPermissionCallback& callback,
bool persist,
ContentSetting content_setting) override;
bool IsRestrictedToSecureOrigins() const override;

DISALLOW_COPY_AND_ASSIGN(AutoplayPermissionContext);
};

#endif // BRAVE_BROWSER_AUTOPLAY_AUTOPLAY_PERMISSION_CONTEXT_H_
Loading