Skip to content

Commit

Permalink
Revert "capture mode: implement customized image capture notification."
Browse files Browse the repository at this point in the history
This reverts commit 0eb6b1e.

Reason for revert: Suspect causing ash_unittests failure on linux-chromeos-dbg

Builder:
https://ci.chromium.org/p/chromium/builders/ci/linux-chromeos-dbg
First build failure:
https://ci.chromium.org/p/chromium/builders/ci/linux-chromeos-dbg/22344

Sample stacktrace:
[1/5610] AcceleratorCommandsTest.ToggleMinimized (1848 ms)
[ RUN      ] AcceleratorCommandsTest.ToggleMaximized
[capture_mode_controller.cc(307)] Check failed: !message_center::MessageViewFactory::HasCustomNotificationViewFactory( kScreenCaptureNotificationType). 
#0 0x7f29bf492bbf base::debug::CollectStackTrace()
#1 0x7f29bf22770a base::debug::StackTrace::StackTrace()
#2 0x7f29bf2276c5 base::debug::StackTrace::StackTrace()
#3 0x7f29bf270d17 logging::LogMessage::~LogMessage()
#4 0x7f29bf271419 logging::LogMessage::~LogMessage()
#5 0x7f29bf1e80bb logging::CheckError::~CheckError()
#6 0x7f29c3a68b49 ash::CaptureModeController::CaptureModeController()
#7 0x7f29c3e2eceb std::__Cr::make_unique<>()
#8 0x7f29c3e1fa8b ash::Shell::Init()
#9 0x7f29c3e1f5de ash::Shell::CreateInstance()
#10 0x55fa098eea0e ash::AshTestHelper::SetUp()
#11 0x55fa098ebdc8 ash::AshTestBase::SetUp()
#12 0x55fa098ebc0e ash::AshTestBase::SetUp()


Original change's description:
> capture mode: implement customized image capture notification.
>
> Bug: 1159111
> Change-Id: I5a96480a929a05a7782f51ae6baea8ddc7c9df10
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2632390
> Reviewed-by: Evan Stade <estade@chromium.org>
> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
> Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#846957}

TBR=estade@chromium.org,xdai@chromium.org,afakhry@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Id535618e328a75dbc829d8b662c8dc99dfe25f21
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1159111
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2648987
Reviewed-by: Takashi Sakamoto <tasak@google.com>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#847060}
  • Loading branch information
tasak authored and Chromium LUCI CQ committed Jan 26, 2021
1 parent ded1825 commit ba6a292
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 196 deletions.
2 changes: 0 additions & 2 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ component("ash") {
"capture_mode/capture_mode_feature_pod_controller.h",
"capture_mode/capture_mode_metrics.cc",
"capture_mode/capture_mode_metrics.h",
"capture_mode/capture_mode_notification_view.cc",
"capture_mode/capture_mode_notification_view.h",
"capture_mode/capture_mode_session.cc",
"capture_mode/capture_mode_session.h",
"capture_mode/capture_mode_settings_entry_view.cc",
Expand Down
14 changes: 1 addition & 13 deletions ash/capture_mode/capture_mode_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <utility>

#include "ash/capture_mode/capture_mode_metrics.h"
#include "ash/capture_mode/capture_mode_notification_view.h"
#include "ash/capture_mode/capture_mode_session.h"
#include "ash/capture_mode/capture_mode_util.h"
#include "ash/capture_mode/video_recording_watcher.h"
Expand Down Expand Up @@ -50,7 +49,6 @@
#include "ui/message_center/message_center.h"
#include "ui/message_center/public/cpp/notification.h"
#include "ui/message_center/public/cpp/notification_delegate.h"
#include "ui/message_center/views/message_view_factory.h"
#include "ui/snapshot/snapshot.h"

namespace ash {
Expand All @@ -68,8 +66,6 @@ constexpr char kScreenCaptureNotificationId[] = "capture_mode_notification";
constexpr char kScreenCaptureStoppedNotificationId[] =
"capture_mode_stopped_notification";
constexpr char kScreenCaptureNotifierId[] = "ash.capture_mode_controller";
constexpr char kScreenCaptureNotificationType[] =
"capture_mode_notification_type";

// The format strings of the file names of captured images.
// TODO(afakhry): Discuss with UX localizing "Screenshot" and "Screen
Expand Down Expand Up @@ -173,7 +169,7 @@ void ShowNotification(
const gfx::VectorIcon& notification_icon = kCaptureModeIcon) {
const auto type = optional_fields.image.IsEmpty()
? message_center::NOTIFICATION_TYPE_SIMPLE
: message_center::NOTIFICATION_TYPE_CUSTOM;
: message_center::NOTIFICATION_TYPE_IMAGE;
std::unique_ptr<message_center::Notification> notification =
CreateSystemNotification(
type, notification_id, l10n_util::GetStringUTF16(title_id),
Expand All @@ -184,8 +180,6 @@ void ShowNotification(
message_center::NotifierType::SYSTEM_COMPONENT,
kScreenCaptureNotifierId),
optional_fields, delegate, notification_icon, warning_level);
if (type == message_center::NOTIFICATION_TYPE_CUSTOM)
notification->set_custom_view_type(kScreenCaptureNotificationType);

// Remove the previous notification before showing the new one if there is
// any.
Expand Down Expand Up @@ -303,12 +297,6 @@ CaptureModeController::CaptureModeController(
&CaptureModeController::RecordAndResetScreenshotsTakenInLastWeek,
weak_ptr_factory_.GetWeakPtr()));

DCHECK(!message_center::MessageViewFactory::HasCustomNotificationViewFactory(
kScreenCaptureNotificationType));
message_center::MessageViewFactory::SetCustomNotificationViewFactory(
kScreenCaptureNotificationType,
base::BindRepeating(&CaptureModeNotificationView::Create));

Shell::Get()->session_controller()->AddObserver(this);
chromeos::PowerManagerClient::Get()->AddObserver(this);
}
Expand Down
125 changes: 0 additions & 125 deletions ash/capture_mode/capture_mode_notification_view.cc

This file was deleted.

53 changes: 0 additions & 53 deletions ash/capture_mode/capture_mode_notification_view.h

This file was deleted.

3 changes: 0 additions & 3 deletions ui/message_center/views/notification_view_md.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ class MESSAGE_CENTER_EXPORT NotificationViewMD
void OnNotificationInputSubmit(size_t index,
const base::string16& text) override;

protected:
views::View* image_container_view() { return image_container_view_; }

private:
FRIEND_TEST_ALL_PREFIXES(NotificationViewMDTest, AppNameExtension);
FRIEND_TEST_ALL_PREFIXES(NotificationViewMDTest, AppNameSystemNotification);
Expand Down

0 comments on commit ba6a292

Please sign in to comment.