Skip to content

Commit

Permalink
update to chromium 84.0.4147.89
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Jul 15, 2020
1 parent f4cc549 commit ca8b867
Show file tree
Hide file tree
Showing 219 changed files with 1,997 additions and 964 deletions.
8 changes: 4 additions & 4 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ gclient_gn_args = [


vars = {
"buildspec_platforms": "linux64, mac64, win, win64",
"buildspec_platforms": "linux64, mac64, win, win64, android",
# Variable that can be used to support multiple build scenarios, like having
# Chromium specific targets in a client project's GN file or sync dependencies
# conditionally etc.
Expand Down Expand Up @@ -184,7 +184,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling V8
# and whatever else without interference from each other.
'v8_revision': '141284ce828b13c08e0eccbf359fcce42e655a43',
'v8_revision': '819e18461e9daf907437a521d90663e827c40e05',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling swarming_client
# and whatever else without interference from each other.
Expand Down Expand Up @@ -251,7 +251,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling devtools-frontend
# and whatever else without interference from each other.
'devtools_frontend_revision': 'b4bb41b298b006fc07d6e7a8722fa720bc5a864c',
'devtools_frontend_revision': '930c3d2ed8d25469f889f8a101f86f8c4c65d458',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling libprotobuf-mutator
# and whatever else without interference from each other.
Expand Down Expand Up @@ -1530,7 +1530,7 @@ deps = {
# Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'),

'src-internal': {
'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@d5f6bfae4831dfde6dc5b1eb7dde6fe130b99fe4',
'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@1a0102f7bf9454cdaed893fb4a213e9490af434a',
'condition': 'checkout_src_internal',
},

Expand Down
2 changes: 1 addition & 1 deletion ash/accelerators/debug_commands.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void HandlePrintViewHierarchy() {

void HandlePrintWindowHierarchy() {
std::ostringstream out;
PrintWindowHierarchy(&out);
PrintWindowHierarchy(&out, /*scrub_data=*/false);
LOG(ERROR) << out.str();
}

Expand Down
22 changes: 15 additions & 7 deletions ash/debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void PrintWindowHierarchy(const aura::Window* active_window,
const aura::Window* focused_window,
aura::Window* window,
int indent,
bool scrub_data,
std::ostringstream* out) {
std::string indent_str(indent, ' ');
std::string name(window->GetName());
Expand Down Expand Up @@ -80,27 +81,34 @@ void PrintWindowHierarchy(const aura::Window* active_window,
std::string* tree_id = window->GetProperty(ui::kChildAXTreeID);
if (tree_id)
*out << " ax_tree_id=" << *tree_id;
base::string16 title(window->GetTitle());
if (!title.empty())
*out << " title=" << title;

if (!scrub_data) {
base::string16 title(window->GetTitle());
if (!title.empty())
*out << " title=" << title;
}

int app_type = window->GetProperty(aura::client::kAppType);
*out << " app_type=" << app_type;
std::string* pkg_name = window->GetProperty(ash::kArcPackageNameKey);
if (pkg_name)
*out << " pkg_name=" << *pkg_name;
*out << '\n';

for (aura::Window* child : window->children())
PrintWindowHierarchy(active_window, focused_window, child, indent + 3, out);
for (aura::Window* child : window->children()) {
PrintWindowHierarchy(active_window, focused_window, child, indent + 3,
scrub_data, out);
}
}

void PrintWindowHierarchy(std::ostringstream* out) {
void PrintWindowHierarchy(std::ostringstream* out, bool scrub_data) {
aura::Window* active_window = window_util::GetActiveWindow();
aura::Window* focused_window = window_util::GetFocusedWindow();
aura::Window::Windows roots = Shell::Get()->GetAllRootWindows();
for (size_t i = 0; i < roots.size(); ++i) {
*out << "RootWindow " << i << ":\n";
PrintWindowHierarchy(active_window, focused_window, roots[i], 0, out);
PrintWindowHierarchy(active_window, focused_window, roots[i], 0, scrub_data,
out);
}
}

Expand Down
33 changes: 30 additions & 3 deletions ash/public/cpp/ash_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,33 @@

#include "ash/public/cpp/ash_features.h"

#include <vector>

#include "ash/public/cpp/ash_switches.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/strings/string_split.h"
#include "base/system/sys_info.h"
#include "build/build_config.h"
#include "chromeos/constants/chromeos_switches.h"

namespace ash {
namespace features {

namespace {

bool ShouldHideShelfButtonsForBoard() {
std::vector<std::string> board =
base::SplitString(base::SysInfo::GetLsbReleaseBoard(), "-",
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
if (board.empty())
return false;
return board[0] == "kukui" || board[0] == "eve" || board[0] == "nocturne" ||
board[0] == "hatch";
}

} // namespace

const base::Feature kAllowAmbientEQ{"AllowAmbientEQ",
base::FEATURE_DISABLED_BY_DEFAULT};

Expand Down Expand Up @@ -122,7 +140,7 @@ const base::Feature kDragFromShelfToHomeOrOverview{
"DragFromShelfToHomeOrOverview", base::FEATURE_DISABLED_BY_DEFAULT};

const base::Feature kHideShelfControlsInTabletMode{
"HideShelfControlsInTabletMode", base::FEATURE_ENABLED_BY_DEFAULT};
"HideShelfControlsInTabletMode", base::FEATURE_DISABLED_BY_DEFAULT};

const base::Feature kSystemTrayMicGainSetting{
"SystemTrayMicGainSetting", base::FEATURE_DISABLED_BY_DEFAULT};
Expand Down Expand Up @@ -237,15 +255,24 @@ bool IsReduceDisplayNotificationsEnabled() {
}

bool IsHideShelfControlsInTabletModeEnabled() {
return base::FeatureList::IsEnabled(kHideShelfControlsInTabletMode) &&
IsDragFromShelfToHomeOrOverviewEnabled();
if (!IsDragFromShelfToHomeOrOverviewEnabled())
return false;

// Enable shelf navigation buttons by default on select number of boards.
static const bool hide_shelf_buttons = ShouldHideShelfButtonsForBoard();
if (hide_shelf_buttons)
return true;

return base::FeatureList::IsEnabled(kHideShelfControlsInTabletMode);
}

bool IsDisplayChangeModalEnabled() {
return base::FeatureList::IsEnabled(kDisplayChangeModal);
}

bool AreContextualNudgesEnabled() {
if (!IsHideShelfControlsInTabletModeEnabled())
return false;
return base::FeatureList::IsEnabled(kContextualNudges);
}

Expand Down
5 changes: 3 additions & 2 deletions ash/public/cpp/debug_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ ASH_EXPORT void PrintLayerHierarchy(std::ostringstream* out);
// Prints current active window's view hierarchy to |out|.
ASH_EXPORT void PrintViewHierarchy(std::ostringstream* out);

// Prints all windows hierarchy to |out|.
ASH_EXPORT void PrintWindowHierarchy(std::ostringstream* out);
// Prints all windows hierarchy to |out|. If |scrub_data| is true, we
// may skip some data fields that are not very important for debugging.
ASH_EXPORT void PrintWindowHierarchy(std::ostringstream* out, bool scrub_data);

} // namespace debug
} // namespace ash
Expand Down
3 changes: 1 addition & 2 deletions ash/shelf/contextual_tooltip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ ContextualNudgeStatusTracker* GetStatusTracker(TooltipType type) {
} // namespace

void RegisterProfilePrefs(PrefRegistrySimple* registry) {
if (features::AreContextualNudgesEnabled())
registry->RegisterDictionaryPref(prefs::kContextualTooltips);
registry->RegisterDictionaryPref(prefs::kContextualTooltips);
}

bool ShouldShowNudge(PrefService* prefs,
Expand Down
6 changes: 4 additions & 2 deletions ash/shelf/contextual_tooltip_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class ContextualTooltipTest : public AshTestBase,
public:
ContextualTooltipTest() {
if (GetParam()) {
scoped_feature_list_.InitAndEnableFeature(
ash::features::kContextualNudges);
scoped_feature_list_.InitWithFeatures(
{ash::features::kContextualNudges,
ash::features::kHideShelfControlsInTabletMode},
{});

} else {
scoped_feature_list_.InitAndDisableFeature(
Expand Down
6 changes: 6 additions & 0 deletions ash/shelf/drag_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ bool DragHandle::MaybeShowDragHandleNudge() {
if (!show_drag_handle_nudge_timer_.IsRunning())
overview_observer_.RemoveAll();

if (!features::AreContextualNudgesEnabled())
return false;

// Do not show drag handle nudge if it is already shown or drag handle is not
// visible.
if (gesture_nudge_target_visibility() ||
Expand All @@ -128,6 +131,9 @@ bool DragHandle::MaybeShowDragHandleNudge() {
}

void DragHandle::ShowDragHandleNudge() {
if (!features::AreContextualNudgesEnabled())
return;

DCHECK(!gesture_nudge_target_visibility_);
PrefService* pref =
Shell::Get()->session_controller()->GetLastActiveUserPrefService();
Expand Down
5 changes: 4 additions & 1 deletion ash/shelf/home_to_overview_nudge_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ class HomeToOverviewNudgeControllerWithNudgesDisabledTest : public AshTestBase {
class HomeToOverviewNudgeControllerTest : public AshTestBase {
public:
HomeToOverviewNudgeControllerTest() {
scoped_feature_list_.InitAndEnableFeature(ash::features::kContextualNudges);
scoped_feature_list_.InitWithFeatures(
{ash::features::kContextualNudges,
ash::features::kHideShelfControlsInTabletMode},
{});
}
~HomeToOverviewNudgeControllerTest() override = default;

Expand Down
2 changes: 1 addition & 1 deletion ash/shelf/scrollable_shelf_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ class ScrollableShelfViewWithAppScalingTest : public ScrollableShelfViewTest {
// Hotseat widget's width is a constant. Then |kAppCount| is in the range
// of [1, (hotseat width) / (shelf button + button spacing) + 1]. So we can
// get |kAppCount| in that range manually
static constexpr int kAppCount = 9;
static constexpr int kAppCount = 8;

private:
base::test::ScopedFeatureList scoped_feature_list_;
Expand Down
11 changes: 11 additions & 0 deletions ash/shelf/shelf_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,15 @@ std::unique_ptr<views::InkDrop> ShelfButton::CreateInkDrop() {
return std::move(ink_drop);
}

void ShelfButton::OnLayerTransformed(const gfx::Transform& old_transform,
ui::PropertyChangeReason reason) {
views::Button::OnLayerTransformed(old_transform, reason);

// Notify the ink drop that we have transformed so it can adapt accordingly.
// TODO(crbug.com/1097044): This should probably be moved lower to ink drop or
// views code, but those may assume bounds changes.
if (HasInkDrop())
GetInkDrop()->HostTransformChanged(GetTransform());
}

} // namespace ash
2 changes: 2 additions & 0 deletions ash/shelf/shelf_button.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class ASH_EXPORT ShelfButton : public views::Button {
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
void NotifyClick(const ui::Event& event) override;
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
void OnLayerTransformed(const gfx::Transform& old_transform,
ui::PropertyChangeReason reason) override;

Shelf* shelf() { return shelf_; }
const Shelf* shelf() const { return shelf_; }
Expand Down
5 changes: 4 additions & 1 deletion ash/shelf/shelf_drag_handle_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ ShelfLayoutManager* GetShelfLayoutManager() {
class DragHandleContextualNudgeTest : public ShelfLayoutManagerTestBase {
public:
DragHandleContextualNudgeTest() {
scoped_feature_list_.InitAndEnableFeature(ash::features::kContextualNudges);
scoped_feature_list_.InitWithFeatures(
{ash::features::kContextualNudges,
ash::features::kHideShelfControlsInTabletMode},
{});
}
~DragHandleContextualNudgeTest() override = default;

Expand Down
37 changes: 32 additions & 5 deletions ash/shelf/shelf_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
#include "ui/views/animation/bounds_animator.h"
#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/animation/test/ink_drop_host_view_test_api.h"
#include "ui/views/animation/test/ink_drop_impl_test_api.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/view_model.h"
#include "ui/views/widget/widget.h"
Expand Down Expand Up @@ -1907,6 +1908,9 @@ class InkDropSpy : public views::InkDrop {
void HostSizeChanged(const gfx::Size& new_size) override {
ink_drop_->HostSizeChanged(new_size);
}
void HostTransformChanged(const gfx::Transform& new_transform) override {
ink_drop_->HostTransformChanged(new_transform);
}
views::InkDropState GetTargetInkDropState() const override {
return ink_drop_->GetTargetInkDropState();
}
Expand Down Expand Up @@ -1978,6 +1982,8 @@ class ListMenuShelfItemDelegate : public ShelfItemDelegate {
class ShelfViewInkDropTest : public ShelfViewTest {
public:
ShelfViewInkDropTest() = default;
ShelfViewInkDropTest(const ShelfViewInkDropTest&) = delete;
ShelfViewInkDropTest& operator=(const ShelfViewInkDropTest&) = delete;
~ShelfViewInkDropTest() override = default;

protected:
Expand All @@ -1995,9 +2001,12 @@ class ShelfViewInkDropTest : public ShelfViewTest {
void InitBrowserButtonInkDrop() {
browser_button_ = test_api_->GetButton(0);

auto ink_drop_impl = std::make_unique<views::InkDropImpl>(
browser_button_, browser_button_->size());
browser_button_ink_drop_impl_ = ink_drop_impl.get();

auto browser_button_ink_drop =
std::make_unique<InkDropSpy>(std::make_unique<views::InkDropImpl>(
browser_button_, browser_button_->size()));
std::make_unique<InkDropSpy>(std::move(ink_drop_impl));
browser_button_ink_drop_ = browser_button_ink_drop.get();
views::test::InkDropHostViewTestApi(browser_button_)
.SetInkDrop(std::move(browser_button_ink_drop));
Expand All @@ -2007,9 +2016,7 @@ class ShelfViewInkDropTest : public ShelfViewTest {
InkDropSpy* home_button_ink_drop_ = nullptr;
ShelfAppButton* browser_button_ = nullptr;
InkDropSpy* browser_button_ink_drop_ = nullptr;

private:
DISALLOW_COPY_AND_ASSIGN(ShelfViewInkDropTest);
views::InkDropImpl* browser_button_ink_drop_impl_ = nullptr;
};

// Tests that changing visibility of the app list transitions home button's
Expand Down Expand Up @@ -2402,6 +2409,26 @@ TEST_F(ShelfViewInkDropTest, DismissingMenuWithDoubleClickDoesntShowInkDrop) {
browser_button_ink_drop_->GetTargetInkDropState());
}

// Tests that the shelf ink drop transforms when the host transforms. Regression
// test for https://crbug.com/1097044.
TEST_F(ShelfViewInkDropTest, ShelfButtonTransformed) {
InitBrowserButtonInkDrop();
ASSERT_TRUE(browser_button_ink_drop_impl_);
auto ink_drop_impl_test_api =
std::make_unique<views::test::InkDropImplTestApi>(
browser_button_ink_drop_impl_);

views::Button* button = browser_button_;
gfx::Transform transform;
transform.Translate(10, 0);
button->SetTransform(transform);
EXPECT_EQ(transform, ink_drop_impl_test_api->GetRootLayer()->transform());

button->SetTransform(gfx::Transform());
EXPECT_EQ(gfx::Transform(),
ink_drop_impl_test_api->GetRootLayer()->transform());
}

class ShelfViewFocusTest : public ShelfViewTest {
public:
ShelfViewFocusTest() = default;
Expand Down
Loading

0 comments on commit ca8b867

Please sign in to comment.