Commit 6791818d authored by yoshiki iguchi's avatar yoshiki iguchi Committed by Commit Bot

Move UiController/UiDelegate to ash

- message_center::UiController -> ash::MessageCenterUiCiontroller
- message_center::UiDelegate -> ash::MessageCenterUiDelegate

These CL moves these classes into ash/, since they are used only from ash.

Bug: 869278
Test: trybot passes

Change-Id: I15390ba972f5c522c5a95bad8c2e1b6281ee8d24
Reviewed-on: https://chromium-review.googlesource.com/1152756Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Commit-Queue: Yoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580110}
parent 6043d5cd
......@@ -425,6 +425,9 @@ component("ash") {
"message_center/message_center_scroll_bar.cc",
"message_center/message_center_scroll_bar.h",
"message_center/message_center_style.h",
"message_center/message_center_ui_controller.cc",
"message_center/message_center_ui_controller.h",
"message_center/message_center_ui_delegate.h",
"message_center/message_center_view.cc",
"message_center/message_center_view.h",
"message_center/message_list_view.cc",
......@@ -1775,6 +1778,7 @@ test("ash_unittests") {
"magnifier/magnifier_test_utils.cc",
"magnifier/magnifier_test_utils.h",
"magnifier/partial_magnification_controller_unittest.cc",
"message_center/message_center_ui_controller_unittest.cc",
"message_center/message_center_view_unittest.cc",
"message_center/message_list_view_unittest.cc",
"message_center/notifier_settings_view_unittest.cc",
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/message_center/ui_controller.h"
#include "ash/message_center/message_center_ui_controller.h"
#include <memory>
......@@ -15,25 +15,25 @@
#include "ui/message_center/message_center.h"
#include "ui/message_center/message_center_types.h"
#include "ui/message_center/notification_blocker.h"
#include "ui/message_center/ui_delegate.h"
#include "ui/message_center/views/notification_menu_model.h"
#include "ui/strings/grit/ui_strings.h"
namespace message_center {
namespace ash {
UiController::UiController(UiDelegate* delegate)
: message_center_(MessageCenter::Get()),
MessageCenterUiController::MessageCenterUiController(
MessageCenterUiDelegate* delegate)
: message_center_(message_center::MessageCenter::Get()),
message_center_visible_(false),
popups_visible_(false),
delegate_(delegate) {
message_center_->AddObserver(this);
}
UiController::~UiController() {
MessageCenterUiController::~MessageCenterUiController() {
message_center_->RemoveObserver(this);
}
bool UiController::ShowMessageCenterBubble(bool show_by_click) {
bool MessageCenterUiController::ShowMessageCenterBubble(bool show_by_click) {
if (message_center_visible_)
return true;
......@@ -41,13 +41,13 @@ bool UiController::ShowMessageCenterBubble(bool show_by_click) {
message_center_visible_ = delegate_->ShowMessageCenter(show_by_click);
if (message_center_visible_) {
message_center_->SetVisibility(VISIBILITY_MESSAGE_CENTER);
message_center_->SetVisibility(message_center::VISIBILITY_MESSAGE_CENTER);
NotifyUiControllerChanged();
}
return message_center_visible_;
}
bool UiController::HideMessageCenterBubble() {
bool MessageCenterUiController::HideMessageCenterBubble() {
if (!message_center_visible_)
return false;
......@@ -57,11 +57,11 @@ bool UiController::HideMessageCenterBubble() {
return true;
}
void UiController::MarkMessageCenterHidden() {
void MessageCenterUiController::MarkMessageCenterHidden() {
if (!message_center_visible_)
return;
message_center_visible_ = false;
message_center_->SetVisibility(VISIBILITY_TRANSIENT);
message_center_->SetVisibility(message_center::VISIBILITY_TRANSIENT);
// Some notifications (like system ones) should appear as popups again
// after the message center is closed.
......@@ -73,7 +73,7 @@ void UiController::MarkMessageCenterHidden() {
NotifyUiControllerChanged();
}
void UiController::ShowPopupBubble() {
void MessageCenterUiController::ShowPopupBubble() {
if (message_center_visible_)
return;
......@@ -90,7 +90,7 @@ void UiController::ShowPopupBubble() {
NotifyUiControllerChanged();
}
bool UiController::HidePopupBubble() {
bool MessageCenterUiController::HidePopupBubble() {
if (!popups_visible_)
return false;
HidePopupBubbleInternal();
......@@ -99,7 +99,7 @@ bool UiController::HidePopupBubble() {
return true;
}
void UiController::HidePopupBubbleInternal() {
void MessageCenterUiController::HidePopupBubbleInternal() {
if (!popups_visible_)
return;
......@@ -107,30 +107,33 @@ void UiController::HidePopupBubbleInternal() {
popups_visible_ = false;
}
void UiController::ShowNotifierSettingsBubble() {
void MessageCenterUiController::ShowNotifierSettingsBubble() {
if (popups_visible_)
HidePopupBubbleInternal();
message_center_visible_ = delegate_->ShowNotifierSettings();
message_center_->SetVisibility(VISIBILITY_SETTINGS);
message_center_->SetVisibility(message_center::VISIBILITY_SETTINGS);
NotifyUiControllerChanged();
}
void UiController::OnNotificationAdded(const std::string& notification_id) {
void MessageCenterUiController::OnNotificationAdded(
const std::string& notification_id) {
OnMessageCenterChanged();
}
void UiController::OnNotificationRemoved(const std::string& notification_id,
bool by_user) {
void MessageCenterUiController::OnNotificationRemoved(
const std::string& notification_id,
bool by_user) {
OnMessageCenterChanged();
}
void UiController::OnNotificationUpdated(const std::string& notification_id) {
void MessageCenterUiController::OnNotificationUpdated(
const std::string& notification_id) {
OnMessageCenterChanged();
}
void UiController::OnNotificationClicked(
void MessageCenterUiController::OnNotificationClicked(
const std::string& notification_id,
const base::Optional<int>& button_index,
const base::Optional<base::string16>& reply) {
......@@ -138,25 +141,27 @@ void UiController::OnNotificationClicked(
OnMessageCenterChanged();
}
void UiController::OnNotificationSettingsClicked(bool handled) {
void MessageCenterUiController::OnNotificationSettingsClicked(bool handled) {
if (!handled)
ShowNotifierSettingsBubble();
}
void UiController::OnNotificationDisplayed(const std::string& notification_id,
const DisplaySource source) {
void MessageCenterUiController::OnNotificationDisplayed(
const std::string& notification_id,
const message_center::DisplaySource source) {
NotifyUiControllerChanged();
}
void UiController::OnQuietModeChanged(bool in_quiet_mode) {
void MessageCenterUiController::OnQuietModeChanged(bool in_quiet_mode) {
NotifyUiControllerChanged();
}
void UiController::OnBlockingStateChanged(NotificationBlocker* blocker) {
void MessageCenterUiController::OnBlockingStateChanged(
message_center::NotificationBlocker* blocker) {
OnMessageCenterChanged();
}
void UiController::OnMessageCenterChanged() {
void MessageCenterUiController::OnMessageCenterChanged() {
if (hide_on_last_notification_ && message_center_visible_ &&
message_center_->NotificationCount() == 0) {
HideMessageCenterBubble();
......@@ -171,8 +176,8 @@ void UiController::OnMessageCenterChanged() {
NotifyUiControllerChanged();
}
void UiController::NotifyUiControllerChanged() {
void MessageCenterUiController::NotifyUiControllerChanged() {
delegate_->OnMessageCenterContentsChanged();
}
} // namespace message_center
} // namespace ash
......@@ -2,29 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_MESSAGE_CENTER_UI_CONTROLLER_H_
#define UI_MESSAGE_CENTER_UI_CONTROLLER_H_
#ifndef ASH_MESSAGE_CENTER_MESSAGE_CENTER_UI_CONTROLLER_H_
#define ASH_MESSAGE_CENTER_MESSAGE_CENTER_UI_CONTROLLER_H_
#include "ash/ash_export.h"
#include "ash/message_center/message_center_ui_delegate.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
#include "ui/message_center/message_center_export.h"
#include "ui/message_center/message_center_observer.h"
#include "ui/message_center/public/cpp/notifier_id.h"
#include "ui/message_center/ui_delegate.h"
namespace message_center {
class MessageCenter;
}
namespace ash {
// Class that observes a MessageCenter and reacts to changes in the list of
// notifications. Manages the popup and message center bubbles. Tells the
// UiDelegate when the tray is changed, as well as when bubbles are shown and
// hidden.
class MESSAGE_CENTER_EXPORT UiController : public MessageCenterObserver {
class ASH_EXPORT MessageCenterUiController
: public message_center::MessageCenterObserver {
public:
explicit UiController(UiDelegate* delegate);
~UiController() override;
explicit MessageCenterUiController(MessageCenterUiDelegate* delegate);
~MessageCenterUiController() override;
// Shows or updates the message center bubble and hides the popup bubble. Set
// |show_by_click| to true if bubble is shown by mouse or gesture click.
......@@ -51,9 +55,11 @@ class MESSAGE_CENTER_EXPORT UiController : public MessageCenterObserver {
bool message_center_visible() { return message_center_visible_; }
bool popups_visible() { return popups_visible_; }
UiDelegate* delegate() { return delegate_; }
const MessageCenter* message_center() const { return message_center_; }
MessageCenter* message_center() { return message_center_; }
MessageCenterUiDelegate* delegate() { return delegate_; }
const message_center::MessageCenter* message_center() const {
return message_center_;
}
message_center::MessageCenter* message_center() { return message_center_; }
void set_hide_on_last_notification(bool hide_on_last_notification) {
hide_on_last_notification_ = hide_on_last_notification;
}
......@@ -68,27 +74,29 @@ class MESSAGE_CENTER_EXPORT UiController : public MessageCenterObserver {
const base::Optional<int>& button_index,
const base::Optional<base::string16>& reply) override;
void OnNotificationSettingsClicked(bool handled) override;
void OnNotificationDisplayed(const std::string& notification_id,
const DisplaySource source) override;
void OnNotificationDisplayed(
const std::string& notification_id,
const message_center::DisplaySource source) override;
void OnQuietModeChanged(bool in_quiet_mode) override;
void OnBlockingStateChanged(NotificationBlocker* blocker) override;
void OnBlockingStateChanged(
message_center::NotificationBlocker* blocker) override;
private:
void OnMessageCenterChanged();
void NotifyUiControllerChanged();
void HidePopupBubbleInternal();
MessageCenter* message_center_;
message_center::MessageCenter* const message_center_;
bool message_center_visible_ = false;
bool popups_visible_ = false;
UiDelegate* delegate_;
MessageCenterUiDelegate* const delegate_;
// Set true to hide MessageCenterView when the last notification is dismissed.
bool hide_on_last_notification_ = true;
DISALLOW_COPY_AND_ASSIGN(UiController);
DISALLOW_COPY_AND_ASSIGN(MessageCenterUiController);
};
} // namespace message_center
} // namespace ash
#endif // UI_MESSAGE_CENTER_UI_CONTROLLER_H_
#endif // ASH_MESSAGE_CENTER_MESSAGE_CENTER_UI_CONTROLLER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/message_center/ui_controller.h"
#include "ash/message_center/message_center_ui_controller.h"
#include <utility>
......@@ -16,10 +16,10 @@
using base::ASCIIToUTF16;
namespace message_center {
namespace ash {
namespace {
class TestNotificationDelegate : public NotificationDelegate {
class TestNotificationDelegate : public message_center::NotificationDelegate {
public:
TestNotificationDelegate() = default;
......@@ -29,7 +29,7 @@ class TestNotificationDelegate : public NotificationDelegate {
DISALLOW_COPY_AND_ASSIGN(TestNotificationDelegate);
};
class MockDelegate : public UiDelegate {
class MockDelegate : public MessageCenterUiDelegate {
public:
MockDelegate() {}
~MockDelegate() override {}
......@@ -51,51 +51,58 @@ class MockDelegate : public UiDelegate {
} // namespace
class UiControllerTest : public testing::Test {
class MessageCenterUiControllerTest : public testing::Test {
public:
UiControllerTest() {}
~UiControllerTest() override {}
MessageCenterUiControllerTest() {}
~MessageCenterUiControllerTest() override {}
void SetUp() override {
MessageCenter::Initialize();
message_center::MessageCenter::Initialize();
delegate_.reset(new MockDelegate);
message_center_ = MessageCenter::Get();
ui_controller_.reset(new UiController(delegate_.get()));
message_center_ = message_center::MessageCenter::Get();
ui_controller_.reset(new MessageCenterUiController(delegate_.get()));
}
void TearDown() override {
ui_controller_.reset();
delegate_.reset();
message_center_ = NULL;
MessageCenter::Shutdown();
message_center::MessageCenter::Shutdown();
}
protected:
NotifierId DummyNotifierId() { return NotifierId(); }
message_center::NotifierId DummyNotifierId() {
return message_center::NotifierId();
}
Notification* AddNotification(const std::string& id) {
message_center::Notification* AddNotification(const std::string& id) {
return AddNotification(id, DummyNotifierId());
}
Notification* AddNotification(const std::string& id, NotifierId notifier_id) {
std::unique_ptr<Notification> notification(new Notification(
NOTIFICATION_TYPE_SIMPLE, id, ASCIIToUTF16("Test Web Notification"),
ASCIIToUTF16("Notification message body."), gfx::Image(),
ASCIIToUTF16("www.test.org"), GURL(), notifier_id,
RichNotificationData(), new TestNotificationDelegate()));
Notification* notification_ptr = notification.get();
message_center::Notification* AddNotification(
const std::string& id,
message_center::NotifierId notifier_id) {
std::unique_ptr<message_center::Notification> notification(
new message_center::Notification(
message_center::NOTIFICATION_TYPE_SIMPLE, id,
ASCIIToUTF16("Test Web Notification"),
ASCIIToUTF16("Notification message body."), gfx::Image(),
ASCIIToUTF16("www.test.org"), GURL(), notifier_id,
message_center::RichNotificationData(),
new TestNotificationDelegate()));
message_center::Notification* notification_ptr = notification.get();
message_center_->AddNotification(std::move(notification));
return notification_ptr;
}
std::unique_ptr<MockDelegate> delegate_;
std::unique_ptr<UiController> ui_controller_;
MessageCenter* message_center_;
std::unique_ptr<MessageCenterUiController> ui_controller_;
message_center::MessageCenter* message_center_;
private:
DISALLOW_COPY_AND_ASSIGN(UiControllerTest);
DISALLOW_COPY_AND_ASSIGN(MessageCenterUiControllerTest);
};
TEST_F(UiControllerTest, BasicMessageCenter) {
TEST_F(MessageCenterUiControllerTest, BasicMessageCenter) {
ASSERT_FALSE(ui_controller_->popups_visible());
ASSERT_FALSE(ui_controller_->message_center_visible());
......@@ -122,7 +129,7 @@ TEST_F(UiControllerTest, BasicMessageCenter) {
ASSERT_FALSE(ui_controller_->message_center_visible());
}
TEST_F(UiControllerTest, BasicPopup) {
TEST_F(MessageCenterUiControllerTest, BasicPopup) {
ASSERT_FALSE(ui_controller_->popups_visible());
ASSERT_FALSE(ui_controller_->message_center_visible());
......@@ -142,7 +149,7 @@ TEST_F(UiControllerTest, BasicPopup) {
ASSERT_FALSE(ui_controller_->message_center_visible());
}
TEST_F(UiControllerTest, MessageCenterClosesPopups) {
TEST_F(MessageCenterUiControllerTest, MessageCenterClosesPopups) {
ASSERT_FALSE(ui_controller_->popups_visible());
ASSERT_FALSE(ui_controller_->message_center_visible());
......@@ -178,16 +185,19 @@ TEST_F(UiControllerTest, MessageCenterClosesPopups) {
ASSERT_FALSE(ui_controller_->message_center_visible());
}
TEST_F(UiControllerTest, MessageCenterReopenPopupsForSystemPriority) {
TEST_F(MessageCenterUiControllerTest,
MessageCenterReopenPopupsForSystemPriority) {
ASSERT_FALSE(ui_controller_->popups_visible());
ASSERT_FALSE(ui_controller_->message_center_visible());
std::unique_ptr<Notification> notification(new Notification(
NOTIFICATION_TYPE_SIMPLE, "MessageCenterReopnPopupsForSystemPriority",
ASCIIToUTF16("Test Web Notification"),
ASCIIToUTF16("Notification message body."), gfx::Image(),
ASCIIToUTF16("www.test.org"), GURL(), DummyNotifierId(),
RichNotificationData(), NULL /* delegate */));
std::unique_ptr<message_center::Notification> notification(
new message_center::Notification(
message_center::NOTIFICATION_TYPE_SIMPLE,
"MessageCenterReopnPopupsForSystemPriority",
ASCIIToUTF16("Test Web Notification"),
ASCIIToUTF16("Notification message body."), gfx::Image(),
ASCIIToUTF16("www.test.org"), GURL(), DummyNotifierId(),
message_center::RichNotificationData(), NULL /* delegate */));
notification->SetSystemPriority();
message_center_->AddNotification(std::move(notification));
......@@ -207,7 +217,7 @@ TEST_F(UiControllerTest, MessageCenterReopenPopupsForSystemPriority) {
ASSERT_FALSE(ui_controller_->message_center_visible());
}
TEST_F(UiControllerTest, ShowBubbleFails) {
TEST_F(MessageCenterUiControllerTest, ShowBubbleFails) {
// Now the delegate will signal that it was unable to show a bubble.
delegate_->show_popups_success_ = false;
delegate_->show_message_center_success_ = false;
......@@ -245,4 +255,4 @@ TEST_F(UiControllerTest, ShowBubbleFails) {
ASSERT_FALSE(ui_controller_->message_center_visible());
}
} // namespace message_center
} // namespace ash
......@@ -2,19 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_MESSAGE_CENTER_UI_DELEGATE_H_
#define UI_MESSAGE_CENTER_UI_DELEGATE_H_
#ifndef ASH_MESSAGE_CENTER_MESSAGE_CENTER_UI_DELEGATE_H_
#define ASH_MESSAGE_CENTER_MESSAGE_CENTER_UI_DELEGATE_H_
#include "ui/message_center/message_center_export.h"
namespace message_center {
namespace ash {
// A UiDelegate class is responsible for managing the various UI surfaces
// (MessageCenter and popups) as notifications are added and updated.
// Implementations are platform specific.
class MESSAGE_CENTER_EXPORT UiDelegate {
class MessageCenterUiDelegate {
public:
virtual ~UiDelegate(){};
virtual ~MessageCenterUiDelegate(){};
// Called whenever a change to the visible UI has occurred.
virtual void OnMessageCenterContentsChanged() = 0;
......@@ -39,6 +37,6 @@ class MESSAGE_CENTER_EXPORT UiDelegate {
virtual bool ShowNotifierSettings() = 0;
};
} // namespace message_center
} // namespace ash
#endif // UI_MESSAGE_CENTER_UI_DELEGATE_H_
#endif // ASH_MESSAGE_CENTER_MESSAGE_CENTER_UI_DELEGATE_H_
......@@ -8,6 +8,7 @@
#include "ash/accessibility/accessibility_controller.h"
#include "ash/message_center/message_center_bubble.h"
#include "ash/message_center/message_center_ui_controller.h"
#include "ash/public/cpp/app_list/app_list_features.h"
#include "ash/public/cpp/ash_switches.h"
#include "ash/resources/vector_icons/vector_icons.h"
......@@ -34,7 +35,6 @@
#include "ui/gfx/paint_vector_icon.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/public/cpp/message_center_constants.h"
#include "ui/message_center/ui_controller.h"
#include "ui/message_center/views/message_popup_collection.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/bubble/tray_bubble_view.h"
......@@ -317,7 +317,7 @@ NotificationTray::NotificationTray(Shelf* shelf,
tray_container()->AddChildView(counter_.get());
message_center_ui_controller_ =
std::make_unique<message_center::UiController>(this);
std::make_unique<MessageCenterUiController>(this);
popup_alignment_delegate_ =
std::make_unique<AshPopupAlignmentDelegate>(shelf);
popup_collection_ = std::make_unique<message_center::MessagePopupCollection>(
......
......@@ -9,12 +9,12 @@
#include "ash/ash_export.h"
#include "ash/login_status.h"
#include "ash/message_center/message_center_ui_delegate.h"
#include "ash/system/tray/tray_background_view.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "ui/gfx/animation/animation_container.h"
#include "ui/message_center/ui_delegate.h"
#include "ui/views/bubble/tray_bubble_view.h"
namespace aura {
......@@ -24,12 +24,12 @@ class Window;
namespace message_center {
class MessageCenter;
class MessagePopupCollection;
class UiController;
} // namespace message_center
namespace ash {
class AshPopupAlignmentDelegate;
class MessageCenterBubble;
class MessageCenterUiController;
class NotificationBubbleWrapper;
class NotificationTrayImageSubview;
class NotificationTrayLabelSubview;
......@@ -39,7 +39,7 @@ class NotificationTrayLabelSubview;
// notification list. This class contains the Ash specific tray implementation.
class ASH_EXPORT NotificationTray
: public TrayBackgroundView,
public message_center::UiDelegate,
public MessageCenterUiDelegate,
public base::SupportsWeakPtr<NotificationTray> {
public:
NotificationTray(Shelf* shelf, aura::Window* status_area_window);
......@@ -128,7 +128,7 @@ class ASH_EXPORT NotificationTray
MessageCenterBubble* GetMessageCenterBubbleForTest();
aura::Window* status_area_window_;
std::unique_ptr<message_center::UiController> message_center_ui_controller_;
std::unique_ptr<MessageCenterUiController> message_center_ui_controller_;
std::unique_ptr<NotificationBubbleWrapper> message_center_bubble_;
std::unique_ptr<message_center::MessagePopupCollection> popup_collection_;
std::unique_ptr<views::View> bell_icon_;
......
......@@ -9,6 +9,7 @@
#include <vector>
#include "ash/message_center/message_center_bubble.h"
#include "ash/message_center/message_center_ui_controller.h"
#include "ash/message_center/message_center_view.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/config.h"
......@@ -41,7 +42,6 @@
#include "ui/message_center/notification_list.h"
#include "ui/message_center/public/cpp/message_center_constants.h"
#include "ui/message_center/public/cpp/notification_types.h"
#include "ui/message_center/ui_controller.h"
#include "ui/message_center/views/message_popup_collection.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/fill_layout.h"
......
......@@ -5,6 +5,8 @@
#include "ash/system/unified/unified_system_tray.h"
#include "ash/accessibility/accessibility_controller.h"
#include "ash/message_center/message_center_ui_controller.h"
#include "ash/message_center/message_center_ui_delegate.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/system/date/date_view.h"
......@@ -27,18 +29,16 @@
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/ui_controller.h"
#include "ui/message_center/ui_delegate.h"
#include "ui/message_center/views/message_popup_collection.h"
namespace ash {
class UnifiedSystemTray::UiDelegate : public message_center::UiDelegate {
class UnifiedSystemTray::UiDelegate : public MessageCenterUiDelegate {
public:
UiDelegate(UnifiedSystemTray* owner);
~UiDelegate() override;
// message_center::UiDelegate:
// MessageCenterUiDelegate:
void OnMessageCenterContentsChanged() override;
bool ShowPopups() override;
void HidePopups() override;
......@@ -46,14 +46,14 @@ class UnifiedSystemTray::UiDelegate : public message_center::UiDelegate {
void HideMessageCenter() override;
bool ShowNotifierSettings() override;
message_center::UiController* ui_controller() { return ui_controller_.get(); }
MessageCenterUiController* ui_controller() { return ui_controller_.get(); }
void SetTrayBubbleHeight(int height) {
popup_alignment_delegate_->SetTrayBubbleHeight(height);
}
private:
std::unique_ptr<message_center::UiController> ui_controller_;
std::unique_ptr<MessageCenterUiController> ui_controller_;
std::unique_ptr<AshPopupAlignmentDelegate> popup_alignment_delegate_;
std::unique_ptr<message_center::MessagePopupCollection>
message_popup_collection_;
......@@ -65,7 +65,7 @@ class UnifiedSystemTray::UiDelegate : public message_center::UiDelegate {
UnifiedSystemTray::UiDelegate::UiDelegate(UnifiedSystemTray* owner)
: owner_(owner) {
ui_controller_ = std::make_unique<message_center::UiController>(this);
ui_controller_ = std::make_unique<MessageCenterUiController>(this);
ui_controller_->set_hide_on_last_notification(false);
popup_alignment_delegate_ =
std::make_unique<AshPopupAlignmentDelegate>(owner->shelf());
......
......@@ -92,7 +92,7 @@ class ASH_EXPORT UnifiedSystemTray : public TrayBackgroundView {
friend class UnifiedSystemTrayTest;
friend class UnifiedSystemTrayTestApi;
// Private class implements message_center::UiDelegate.
// Private class implements MessageCenterUiDelegate.
class UiDelegate;
// Private class implements TrayNetworkStateObserver::Delegate.
......
......@@ -107,15 +107,6 @@ jumbo_component("message_center") {
]
}
# TODO(yoshiki): move the following files to ash/message_center.
if (is_chromeos) {
sources += [
"ui_controller.cc",
"ui_controller.h",
"ui_delegate.h",
]
}
# On Mac, toolkit-views builds still use the Cocoa UI. Keep this in sync
# with message_center_unittests below.
if (toolkit_views && !is_mac) {
......@@ -239,12 +230,7 @@ if (enable_message_center) {
]
if (is_chromeos) {
sources += [
"public/mojo/struct_traits_unittest.cc",
# TODO(yoshiki): move ui_controller_unittest.cc to ash/message_center.
"ui_controller_unittest.cc",
]
sources += [ "public/mojo/struct_traits_unittest.cc" ]
deps += [
"//mojo/core/embedder",
......
......@@ -13,7 +13,6 @@
#include "ui/message_center/message_center.h"
#include "ui/message_center/public/cpp/notification.h"
#include "ui/message_center/public/cpp/notification_types.h"
#include "ui/message_center/ui_controller.h"
namespace message_center {
namespace {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment