Skip to content

Commit

Permalink
update to chromium 87.0.4280.88
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Dec 5, 2020
1 parent 874a66b commit 56f867d
Show file tree
Hide file tree
Showing 241 changed files with 11,264 additions and 1,041 deletions.
6 changes: 3 additions & 3 deletions DEPS
Expand Up @@ -201,7 +201,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': '3cd8a8915ce4f62b50e6371f5b7fc155b5d78413',
'v8_revision': '45d51f3f97a6058fced26b9c378fba5dcd924704',
# 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 @@ -1491,7 +1491,7 @@ deps = {
},

'src/third_party/webrtc':
Var('webrtc_git') + '/src.git' + '@' + 'a1aa01aad009d29d7fa00f6d407d919372e5ecf8',
Var('webrtc_git') + '/src.git' + '@' + '69202b2a57b8b7f7046dc26930aafd6f779a152e',

'src/third_party/libgifcodec':
Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'),
Expand Down Expand Up @@ -1563,7 +1563,7 @@ deps = {
# Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'),

'src-internal': {
'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@2f3f492fc1edb354af4e307f3ad873380d56cf61',
'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@793bbaac5d5aa00d07666c05446a37949c634aee',
'condition': 'checkout_src_internal',
},

Expand Down
12 changes: 12 additions & 0 deletions ash/child_accounts/parent_access_controller_impl.cc
Expand Up @@ -9,8 +9,10 @@
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "base/bind.h"
#include "base/check.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string16.h"
#include "components/session_manager/session_manager_types.h"
#include "ui/base/l10n/l10n_util.h"

namespace ash {
Expand Down Expand Up @@ -171,6 +173,16 @@ bool ParentAccessControllerImpl::ShowWidget(
if (PinRequestWidget::Get())
return false;

// When there is no logged in user we should accept parent access code for any
// of child account added to the device.
const auto session_state =
Shell::Get()->session_controller()->GetSessionState();
const bool user_in_session =
session_state == session_manager::SessionState::LOGGED_IN_NOT_ACTIVE ||
session_state == session_manager::SessionState::ACTIVE ||
session_state == session_manager::SessionState::LOCKED;
DCHECK(user_in_session || child_account_id.empty());

account_id_ = child_account_id;
action_ = action;
validation_time_ = validation_time;
Expand Down
56 changes: 49 additions & 7 deletions ash/child_accounts/parent_access_controller_impl_unittest.cc
Expand Up @@ -12,7 +12,10 @@
#include "ash/login/ui/views_utils.h"
#include "ash/public/cpp/child_accounts/parent_access_controller.h"
#include "base/bind.h"
#include "base/dcheck_is_on.h"
#include "base/test/metrics/histogram_tester.h"
#include "components/account_id/account_id.h"
#include "components/session_manager/session_manager_types.h"
#include "ui/events/base_event_utils.h"
#include "ui/views/controls/button/label_button.h"

Expand All @@ -22,10 +25,13 @@ namespace {

using ::testing::_;

AccountId GetChildAccountId() {
return AccountId::FromUserEmail("child@gmail.com");
}

class ParentAccessControllerImplTest : public LoginTestBase {
protected:
ParentAccessControllerImplTest()
: account_id_(AccountId::FromUserEmail("child@gmail.com")) {}
ParentAccessControllerImplTest() : account_id_(GetChildAccountId()) {}
~ParentAccessControllerImplTest() override = default;

// LoginScreenTest:
Expand Down Expand Up @@ -55,11 +61,23 @@ class ParentAccessControllerImplTest : public LoginTestBase {
access_granted ? ++successful_validation_ : ++back_action_;
}

void StartParentAccess(
SupervisedAction action = SupervisedAction::kUnlockTimeLimits) {
// Starts parent access validation.
// Use this overloaded method if session state and supervised action are not
// relevant.
void StartParentAccess() {
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOCKED);
StartParentAccess(account_id_, SupervisedAction::kUnlockTimeLimits);
}

// Starts parent access validation with supervised |action|.
// Session state should be configured accordingly to the |action|.
void StartParentAccess(SupervisedAction action) {
StartParentAccess(account_id_, action);
}

// Starts parent access validation with supervised |action| and |account_id|.
// Session state should be configured accordingly to the |action|.
void StartParentAccess(const AccountId& account_id, SupervisedAction action) {
validation_time_ = base::Time::Now();
ash::ParentAccessController::Get()->ShowWidget(
Expand Down Expand Up @@ -137,6 +155,8 @@ TEST_F(ParentAccessControllerImplTest, ParentAccessDialogFocus) {

// Tests correct UMA reporting for parent access.
TEST_F(ParentAccessControllerImplTest, ParentAccessUMARecording) {
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOCKED);
StartParentAccess(SupervisedAction::kUnlockTimeLimits);
histogram_tester_.ExpectBucketCount(
ParentAccessControllerImpl::kUMAParentAccessCodeUsage,
Expand All @@ -145,6 +165,8 @@ TEST_F(ParentAccessControllerImplTest, ParentAccessUMARecording) {
ExpectUMAActionReported(
ParentAccessControllerImpl::UMAAction::kCanceledByUser, 1, 1);

GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::ACTIVE);
StartParentAccess(SupervisedAction::kUpdateTimezone);
histogram_tester_.ExpectBucketCount(
ParentAccessControllerImpl::kUMAParentAccessCodeUsage,
Expand All @@ -153,7 +175,6 @@ TEST_F(ParentAccessControllerImplTest, ParentAccessUMARecording) {
ExpectUMAActionReported(
ParentAccessControllerImpl::UMAAction::kCanceledByUser, 2, 2);

// The below usage depends on the session state.
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::ACTIVE);
StartParentAccess(SupervisedAction::kUpdateClock);
Expand All @@ -166,7 +187,7 @@ TEST_F(ParentAccessControllerImplTest, ParentAccessUMARecording) {

GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOGIN_PRIMARY);
StartParentAccess(SupervisedAction::kUpdateClock);
StartParentAccess(EmptyAccountId(), SupervisedAction::kUpdateClock);
histogram_tester_.ExpectBucketCount(
ParentAccessControllerImpl::kUMAParentAccessCodeUsage,
ParentAccessControllerImpl::UMAUsage::kTimeChangeLoginScreen, 1);
Expand All @@ -186,7 +207,7 @@ TEST_F(ParentAccessControllerImplTest, ParentAccessUMARecording) {

GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOGIN_PRIMARY);
StartParentAccess(SupervisedAction::kReauth);
StartParentAccess(EmptyAccountId(), SupervisedAction::kReauth);
histogram_tester_.ExpectBucketCount(
ParentAccessControllerImpl::kUMAParentAccessCodeUsage,
ParentAccessControllerImpl::UMAUsage::kReauhLoginScreen, 1);
Expand Down Expand Up @@ -238,5 +259,26 @@ TEST_F(ParentAccessControllerImplTest, ParentAccessUnsuccessfulValidation) {
ParentAccessControllerImpl::UMAAction::kCanceledByUser, 1, 3);
}

#if DCHECK_IS_ON()
// Tests that on login screen we check parent access code against all accounts.
TEST_F(ParentAccessControllerImplTest, EnforceNoAccountSpecifiedOnLogin) {
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOGIN_PRIMARY);
EXPECT_DEATH_IF_SUPPORTED(
StartParentAccess(GetChildAccountId(), SupervisedAction::kReauth), "");

GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOGIN_PRIMARY);
EXPECT_DEATH_IF_SUPPORTED(
StartParentAccess(GetChildAccountId(), SupervisedAction::kAddUser), "");

GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOGIN_PRIMARY);
EXPECT_DEATH_IF_SUPPORTED(
StartParentAccess(GetChildAccountId(), SupervisedAction::kUpdateClock),
"");
}
#endif

} // namespace
} // namespace ash
2 changes: 1 addition & 1 deletion ash/strings/ash_strings_ca.xtb
Expand Up @@ -72,7 +72,7 @@ A continuació t'indico algunes coses que pots provar per començar.</translatio
<translation id="1589090746204042747">Accedir a tota la teva activitat d'aquesta sessió.</translation>
<translation id="1611993646327628135">Activat</translation>
<translation id="1632985212731562677">L'accés amb interruptors es pot desactivar a Configuració &gt; Accessibilitat.</translation>
<translation id="1651447046299738444">Sembla que el Bluetooth o la Wi-Fi estan desactivats al teu Chromebook. Comprova la connexió per utilitzar Phone Hub.</translation>
<translation id="1651447046299738444">Sembla que el Bluetooth o la Wi-Fi estan desactivats al teu Chromebook. Comprova la connexió per utilitzar El meu telèfon.</translation>
<translation id="1654477262762802994">Inicia una consulta per veu</translation>
<translation id="1667964833127753507">El mode de color neutre no utilitza colors extrets del fons de pantalla, sinó que els substitueix per un conjunt de tons neutres clars o foscos.</translation>
<translation id="1677472565718498478">Temps restant: <ph name="TIME" /></translation>
Expand Down
2 changes: 1 addition & 1 deletion ash/strings/ash_strings_ja.xtb
Expand Up @@ -16,7 +16,7 @@
<translation id="1104084341931202936">ユーザー補助機能の設定を表示</translation>
<translation id="1104621072296271835">デバイスを連携させると活用の幅が広がります</translation>
<translation id="1119348796022671382">壁紙から抽出した色を使用して、インターフェースに薄く色付けします。</translation>
<translation id="112308213915226829">シェルフを自動的に隠す</translation>
<translation id="112308213915226829">シェルフを自動的に非表示にする</translation>
<translation id="1153356358378277386">ペア設定されたデバイス</translation>
<translation id="1175572348579024023">スクロール</translation>
<translation id="1178581264944972037">一時停止</translation>
Expand Down
2 changes: 1 addition & 1 deletion ash/strings/ash_strings_kk.xtb
Expand Up @@ -543,7 +543,7 @@
<translation id="6501401484702599040">Экранды <ph name="RECEIVER_NAME" /> құрылғысына трансляциялау</translation>
<translation id="652139407789908527">Жаңарту кезінде экраныңыз әдеттегіден ұзағырақ уақыт (бір минутқа дейін) өшіп тұрады. Жаңарту кезінде қуат түймесін баспаңыз.</translation>
<translation id="6528179044667508675">Мазаламау</translation>
<translation id="65320610082834431">Эмодзилер</translation>
<translation id="65320610082834431">Эмоджилер</translation>
<translation id="6537270692134705506">Экранды түсіріп алу</translation>
<translation id="6537924328260219877">Сигнал күші: <ph name="SIGNAL_STRENGTH" />, телефон батареясы: <ph name="BATTERY_STATUS" /></translation>
<translation id="6542521951477560771"><ph name="RECEIVER_NAME" /> құрылғысына трансляциялануда</translation>
Expand Down
49 changes: 49 additions & 0 deletions ash/wm/window_cycle_controller_unittest.cc
Expand Up @@ -1168,6 +1168,55 @@ TEST_F(InteractiveWindowCycleControllerTest, TapSelect) {
EXPECT_TRUE(wm::IsActiveWindow(w1.get()));
}

// Tests that mouse events are filtered until the mouse is actually used,
// preventing the mouse from unexpectedly triggering events.
// See crbug.com/1143275.
TEST_F(InteractiveWindowCycleControllerTest, FilterMouseEventsUntilUsed) {
std::unique_ptr<Window> w0 = CreateTestWindow();
std::unique_ptr<Window> w1 = CreateTestWindow();
std::unique_ptr<Window> w2 = CreateTestWindow();
EventCounter event_count;
ui::test::EventGenerator* generator = GetEventGenerator();
WindowCycleController* controller = Shell::Get()->window_cycle_controller();

// Start cycling.
// Current window order is [2,1,0].
controller->StartCycling();
auto item_views = GetWindowCycleItemViews();
item_views[2]->AddPreTargetHandler(&event_count);

// Move the mouse over to the third item and complete cycling. These mouse
// events shouldn't be filtered since the user has moved their mouse.
generator->MoveMouseTo(gfx::Point(0, 0));
const gfx::Point third_item_center =
GetWindowCycleItemViews()[2]->GetBoundsInScreen().CenterPoint();
generator->MoveMouseTo(third_item_center);
controller->CompleteCycling();
EXPECT_TRUE(wm::IsActiveWindow(w0.get()));
EXPECT_LT(0, event_count.GetMouseEventCountAndReset());

// Start cycling again while the mouse is over where the third item will be
// when cycling starts.
// Current window order is [0,2,1].
controller->StartCycling();
item_views = GetWindowCycleItemViews();
item_views[2]->AddPreTargetHandler(&event_count);

// Generate mouse events at the cursor's initial position. These mouse events
// should be filtered because the user hasn't moved their mouse yet.
generator->MoveMouseTo(third_item_center);
controller->CompleteCycling();
EXPECT_TRUE(wm::IsActiveWindow(w0.get()));
EXPECT_EQ(0, event_count.GetMouseEventCountAndReset());

// Start cycling again and click. This should not be filtered out.
// Current window order is [0,2,1].
controller->StartCycling();
generator->PressLeftButton();
EXPECT_FALSE(controller->IsCycling());
EXPECT_TRUE(wm::IsActiveWindow(w1.get()));
}

// When a user has the window cycle list open and clicks outside of it, it
// should cancel cycling.
TEST_F(InteractiveWindowCycleControllerTest,
Expand Down
39 changes: 36 additions & 3 deletions ash/wm/window_cycle_event_filter.cc
Expand Up @@ -5,16 +5,24 @@
#include "ash/wm/window_cycle_event_filter.h"

#include "ash/accelerators/debug_commands.h"
#include "ash/display/screen_ash.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/shell.h"
#include "ash/wm/window_cycle_controller.h"
#include "ash/wm/window_cycle_list.h"
#include "base/bind.h"
#include "ui/events/event.h"
#include "ui/wm/core/coordinate_conversion.h"

namespace ash {

WindowCycleEventFilter::WindowCycleEventFilter() {
// The distance a user has to move their mouse from |initial_mouse_location_|
// before this stops filtering mouse events.
constexpr int kMouseMovementThreshold = 5;

WindowCycleEventFilter::WindowCycleEventFilter()
: initial_mouse_location_(
display::Screen::GetScreen()->GetCursorScreenPoint()) {
Shell::Get()->AddPreTargetHandler(this);
// Handling release of "Alt" must come before other pretarget handlers
// (specifically, the partial screenshot handler). See crbug.com/651939
Expand Down Expand Up @@ -89,6 +97,26 @@ bool WindowCycleEventFilter::ShouldRepeatKey(ui::KeyEvent* event) const {
!repeat_timer_.IsRunning();
}

void WindowCycleEventFilter::SetHasUserUsedMouse(ui::MouseEvent* event) {
if (event->type() != ui::ET_MOUSE_MOVED &&
event->type() != ui::ET_MOUSE_ENTERED &&
event->type() != ui::ET_MOUSE_EXITED) {
// If a user clicks/drags/scrolls mouse wheel, then they have used the
// mouse.
has_user_used_mouse_ = true;
return;
}

aura::Window* target = static_cast<aura::Window*>(event->target());
aura::Window* event_root = target->GetRootWindow();
gfx::Point event_screen_point = event->root_location();
wm::ConvertPointToScreen(event_root, &event_screen_point);
if ((initial_mouse_location_ - event_screen_point).Length() >
kMouseMovementThreshold) {
has_user_used_mouse_ = true;
}
}

WindowCycleController::Direction WindowCycleEventFilter::GetDirection(
ui::KeyEvent* event) const {
DCHECK(IsTriggerKey(event));
Expand All @@ -103,13 +131,18 @@ WindowCycleController::Direction WindowCycleEventFilter::GetDirection(
}

void WindowCycleEventFilter::OnMouseEvent(ui::MouseEvent* event) {
if (!has_user_used_mouse_)
SetHasUserUsedMouse(event);

if (features::IsInteractiveWindowCycleListEnabled()) {
WindowCycleController* window_cycle_controller =
Shell::Get()->window_cycle_controller();
const bool cycle_list_is_visible =
window_cycle_controller->IsWindowListVisible();
if (window_cycle_controller->IsEventInCycleView(event) ||
!cycle_list_is_visible) {
const bool event_should_not_be_filtered =
has_user_used_mouse_ &&
window_cycle_controller->IsEventInCycleView(event);
if (event_should_not_be_filtered || !cycle_list_is_visible) {
return;
} else if (event->type() == ui::ET_MOUSE_PRESSED && cycle_list_is_visible) {
// Close the window cycle list if a user clicks outside of it.
Expand Down
17 changes: 17 additions & 0 deletions ash/wm/window_cycle_event_filter.h
Expand Up @@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/timer/timer.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/geometry/point.h"

namespace ash {

Expand Down Expand Up @@ -54,6 +55,10 @@ class ASH_EXPORT WindowCycleEventFilter : public ui::EventHandler {
// direction given by |event|.
bool ShouldRepeatKey(ui::KeyEvent* event) const;

// Given |event|, determine if the user has used their mouse, i.e. moved or
// clicked.
void SetHasUserUsedMouse(ui::MouseEvent* event);

// Returns the direction the window cycle should cycle depending on the
// combination of keys being pressed.
WindowCycleController::Direction GetDirection(ui::KeyEvent* event) const;
Expand All @@ -66,6 +71,18 @@ class ASH_EXPORT WindowCycleEventFilter : public ui::EventHandler {

AltReleaseHandler alt_release_handler_;

// Stores the initial mouse coordinates. Used to determine whether
// |has_user_used_mouse_| when this handles mouse events.
gfx::Point initial_mouse_location_;

// Bool for tracking whether the user has used their mouse. If this is false,
// mouse events should be filtered. This is to prevent the initial mouse
// position from triggering window cycle items' mouse event handlers despite a
// user not moving their mouse. Should be set to true when a user moves their
// mouse enough or clicks/drags/mousewheel scrolls.
// See crbug.com/114375.
bool has_user_used_mouse_ = false;

DISALLOW_COPY_AND_ASSIGN(WindowCycleEventFilter);
};

Expand Down
14 changes: 11 additions & 3 deletions base/android/java/src/org/chromium/base/RadioUtils.java
Expand Up @@ -97,8 +97,16 @@ private static int getCellSignalLevel() {
TelephonyManager telephonyManager =
(TelephonyManager) ContextUtils.getApplicationContext().getSystemService(
Context.TELEPHONY_SERVICE);
SignalStrength signalStrength = telephonyManager.getSignalStrength();
if (signalStrength == null) return -1;
return signalStrength.getLevel();
int level = -1;
try {
SignalStrength signalStrength = telephonyManager.getSignalStrength();
if (signalStrength != null) {
level = signalStrength.getLevel();
}
} catch (java.lang.SecurityException e) {
// Sometimes SignalStrength.getLevel() requires extra permissions
// that Chrome doesn't have. See crbug.com/1150536.
}
return level;
}
}

0 comments on commit 56f867d

Please sign in to comment.