Skip to content

Commit

Permalink
ash: system/web_notification -> message_center
Browse files Browse the repository at this point in the history
Rename ash/system/web_notification to message_center/ since it holds
ash message center UI code rather than web notification related code.

Also fixed a few presubmit warnings.

Bug: 768439
Change-Id: Ifaf7b8795ebdebff482dc9ac25ab9961dcb6d939
Reviewed-on: https://chromium-review.googlesource.com/1047986
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556829}
  • Loading branch information
Xiyuan Xia authored and Commit Bot committed May 8, 2018
1 parent 473ae15 commit 522710a
Show file tree
Hide file tree
Showing 39 changed files with 261 additions and 268 deletions.
28 changes: 14 additions & 14 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,16 @@ component("ash") {
"system/locale/locale_notification_controller.h",
"system/media_security/multi_profile_media_tray_item.cc",
"system/media_security/multi_profile_media_tray_item.h",
"system/message_center/ash_popup_alignment_delegate.cc",
"system/message_center/ash_popup_alignment_delegate.h",
"system/message_center/fullscreen_notification_blocker.cc",
"system/message_center/fullscreen_notification_blocker.h",
"system/message_center/inactive_user_notification_blocker.cc",
"system/message_center/inactive_user_notification_blocker.h",
"system/message_center/notification_tray.cc",
"system/message_center/notification_tray.h",
"system/message_center/session_state_notification_blocker.cc",
"system/message_center/session_state_notification_blocker.h",
"system/model/clock_model.cc",
"system/model/clock_model.h",
"system/model/enterprise_domain_model.cc",
Expand Down Expand Up @@ -889,16 +899,6 @@ component("ash") {
"system/virtual_keyboard/virtual_keyboard_observer.h",
"system/virtual_keyboard/virtual_keyboard_tray.cc",
"system/virtual_keyboard/virtual_keyboard_tray.h",
"system/web_notification/ash_popup_alignment_delegate.cc",
"system/web_notification/ash_popup_alignment_delegate.h",
"system/web_notification/fullscreen_notification_blocker.cc",
"system/web_notification/fullscreen_notification_blocker.h",
"system/web_notification/inactive_user_notification_blocker.cc",
"system/web_notification/inactive_user_notification_blocker.h",
"system/web_notification/session_state_notification_blocker.cc",
"system/web_notification/session_state_notification_blocker.h",
"system/web_notification/web_notification_tray.cc",
"system/web_notification/web_notification_tray.h",
"touch/ash_touch_transform_controller.cc",
"touch/ash_touch_transform_controller.h",
"touch/touch_devices_controller.cc",
Expand Down Expand Up @@ -1679,6 +1679,10 @@ test("ash_unittests") {
"system/ime_menu/ime_menu_tray_unittest.cc",
"system/keyboard_brightness/tray_keyboard_brightness_unittest.cc",
"system/media_security/multi_profile_media_tray_item_unittest.cc",
"system/message_center/ash_popup_alignment_delegate_unittest.cc",
"system/message_center/inactive_user_notification_blocker_unittest.cc",
"system/message_center/notification_tray_unittest.cc",
"system/message_center/session_state_notification_blocker_unittest.cc",
"system/network/network_icon_unittest.cc",
"system/network/sms_observer_unittest.cc",
"system/network/tray_network_unittest.cc",
Expand Down Expand Up @@ -1735,10 +1739,6 @@ test("ash_unittests") {
"system/unified/unified_system_info_view_unittest.cc",
"system/update/tray_update_unittest.cc",
"system/user/tray_user_unittest.cc",
"system/web_notification/ash_popup_alignment_delegate_unittest.cc",
"system/web_notification/inactive_user_notification_blocker_unittest.cc",
"system/web_notification/session_state_notification_blocker_unittest.cc",
"system/web_notification/web_notification_tray_unittest.cc",
"test/ash_test_helper_unittest.cc",
"test/ash_unittests.cc",
"tooltips/tooltip_controller_unittest.cc",
Expand Down
7 changes: 3 additions & 4 deletions ash/accelerators/accelerator_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "ash/system/brightness_control_delegate.h"
#include "ash/system/ime_menu/ime_menu_tray.h"
#include "ash/system/keyboard_brightness_control_delegate.h"
#include "ash/system/message_center/notification_tray.h"
#include "ash/system/palette/palette_tray.h"
#include "ash/system/palette/palette_utils.h"
#include "ash/system/power/power_button_controller.h"
Expand All @@ -49,7 +50,6 @@
#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_notifier.h"
#include "ash/system/unified/unified_system_tray.h"
#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/touch/touch_hud_debug.h"
#include "ash/utility/screenshot_controller.h"
#include "ash/voice_interaction/voice_interaction_controller.h"
Expand Down Expand Up @@ -409,7 +409,7 @@ bool CanHandleToggleMessageCenterBubble() {
StatusAreaWidget* status_area_widget =
Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget();
return status_area_widget &&
status_area_widget->web_notification_tray()->visible();
status_area_widget->notification_tray()->visible();
}

void HandleToggleMessageCenterBubble() {
Expand All @@ -419,8 +419,7 @@ void HandleToggleMessageCenterBubble() {
Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget();
if (!status_area_widget)
return;
WebNotificationTray* notification_tray =
status_area_widget->web_notification_tray();
NotificationTray* notification_tray = status_area_widget->notification_tray();
if (!notification_tray->visible())
return;
if (notification_tray->IsMessageCenterVisible())
Expand Down
4 changes: 2 additions & 2 deletions ash/accessibility/key_accessibility_enabler_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "ash/accessibility/accessibility_controller.h"
#include "ash/accessibility/accessibility_observer.h"
#include "ash/shell.h"
#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/system/message_center/notification_tray.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "base/run_loop.h"
Expand All @@ -23,7 +23,7 @@ class KeyAccessibilityEnablerTest : public AshTestBase,
KeyAccessibilityEnablerTest() {}

void SetUp() override {
WebNotificationTray::DisableAnimationsForTest(true);
NotificationTray::DisableAnimationsForTest(true);
ui::SetEventTickClockForTesting(&clock_);
AshTestBase::SetUp();
Shell::Get()->accessibility_controller()->AddObserver(this);
Expand Down
6 changes: 3 additions & 3 deletions ash/message_center/message_center_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

#include "ash/ash_export.h"
#include "ash/public/interfaces/ash_message_center_controller.mojom.h"
#include "ash/system/web_notification/fullscreen_notification_blocker.h"
#include "ash/system/web_notification/inactive_user_notification_blocker.h"
#include "ash/system/web_notification/session_state_notification_blocker.h"
#include "ash/system/message_center/fullscreen_notification_blocker.h"
#include "ash/system/message_center/inactive_user_notification_blocker.h"
#include "ash/system/message_center/session_state_notification_blocker.h"
#include "base/macros.h"
#include "components/arc/common/notifications.mojom.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
Expand Down
6 changes: 3 additions & 3 deletions ash/session/session_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#include "ash/session/session_observer.h"
#include "ash/session/test_session_controller_client.h"
#include "ash/shell.h"
#include "ash/system/message_center/notification_tray.h"
#include "ash/system/screen_security/screen_tray_item.h"
#include "ash/system/tray/system_tray.h"
#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/overview/window_selector_controller.h"
#include "ash/wm/window_util.h"
Expand Down Expand Up @@ -564,12 +564,12 @@ class CanSwitchUserTest : public AshTestBase {
capture_item_ = system_tray->GetScreenCaptureItem();
EXPECT_TRUE(share_item_);
EXPECT_TRUE(capture_item_);
WebNotificationTray::DisableAnimationsForTest(true);
NotificationTray::DisableAnimationsForTest(true);
}

void TearDown() override {
RunAllPendingInMessageLoop();
WebNotificationTray::DisableAnimationsForTest(false);
NotificationTray::DisableAnimationsForTest(false);
AshTestBase::TearDown();
}

Expand Down
2 changes: 1 addition & 1 deletion ash/shelf/shelf_layout_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class ASH_EXPORT ShelfLayoutManager
class UpdateShelfObserver;
friend class PanelLayoutManagerTest;
friend class ShelfLayoutManagerTest;
friend class WebNotificationTrayTest;
friend class NotificationTrayTest;

struct TargetBounds {
TargetBounds();
Expand Down
6 changes: 3 additions & 3 deletions ash/shelf/shelf_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/shell_test_api.h"
#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/system/message_center/notification_tray.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/ash_test_helper.h"
#include "ash/test_shell_delegate.h"
Expand Down Expand Up @@ -261,7 +261,7 @@ class ShelfViewTest : public AshTestBase {
model_ = Shell::Get()->shelf_model();
shelf_view_ = GetPrimaryShelf()->GetShelfViewForTesting();

WebNotificationTray::DisableAnimationsForTest(true);
NotificationTray::DisableAnimationsForTest(true);

// The bounds should be big enough for 4 buttons + overflow chevron.
shelf_view_->SetBounds(0, 0, 500, kShelfSize);
Expand All @@ -274,7 +274,7 @@ class ShelfViewTest : public AshTestBase {
}

void TearDown() override {
WebNotificationTray::DisableAnimationsForTest(false); // Reenable animation
NotificationTray::DisableAnimationsForTest(false); // Reenable animation
test_api_.reset();
AshTestBase::TearDown();
}
Expand Down
4 changes: 2 additions & 2 deletions ash/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,10 @@ void Shell::UpdateShelfVisibility() {
Shelf::ForWindow(root)->UpdateVisibilityState();
}

WebNotificationTray* Shell::GetWebNotificationTray() {
NotificationTray* Shell::GetNotificationTray() {
return GetPrimaryRootWindowController()
->GetStatusAreaWidget()
->web_notification_tray();
->notification_tray();
}

bool Shell::HasPrimaryStatusArea() {
Expand Down
6 changes: 3 additions & 3 deletions ash/shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class VoiceInteractionController;
class VpnList;
class WallpaperController;
class WaylandServerController;
class WebNotificationTray;
class NotificationTray;
class WindowCycleController;
class WindowPositioner;
class WindowSelectorController;
Expand Down Expand Up @@ -556,8 +556,8 @@ class ASH_EXPORT Shell : public SessionObserver,
// TODO(jamescook): Move to Shelf.
void UpdateShelfVisibility();

// Returns WebNotificationTray on the primary root window.
WebNotificationTray* GetWebNotificationTray();
// Returns NotificationTray on the primary root window.
NotificationTray* GetNotificationTray();

// Does the primary display have status area?
bool HasPrimaryStatusArea();
Expand Down
4 changes: 2 additions & 2 deletions ash/shell/window_type_launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "ash/shell/example_factory.h"
#include "ash/shell/panel_window.h"
#include "ash/shell/toplevel_window.h"
#include "ash/system/message_center/notification_tray.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/wm/test_child_modal_parent.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/aura/window.h"
Expand Down Expand Up @@ -303,7 +303,7 @@ void WindowTypeLauncher::ButtonPressed(views::Button* sender,

Shell::GetPrimaryRootWindowController()
->GetStatusAreaWidget()
->web_notification_tray()
->notification_tray()
->message_center()
->AddNotification(std::move(notification));
} else if (sender == examples_button_) {
Expand Down
2 changes: 1 addition & 1 deletion ash/sidebar/sidebar_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/system/message_center/notification_tray.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/web_notification/web_notification_tray.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/app_list/views/app_list_view.h"
#include "ui/aura/window.h"
Expand Down
6 changes: 3 additions & 3 deletions ash/system/caps_lock_notification_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "ash/accessibility/accessibility_controller.h"
#include "ash/accessibility/test_accessibility_controller_client.h"
#include "ash/shell.h"
#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/system/message_center/notification_tray.h"
#include "ash/test/ash_test_base.h"

namespace ash {
Expand All @@ -19,11 +19,11 @@ class CapsLockNotificationControllerTest : public AshTestBase {

void SetUp() override {
AshTestBase::SetUp();
WebNotificationTray::DisableAnimationsForTest(true);
NotificationTray::DisableAnimationsForTest(true);
}

void TearDown() override {
WebNotificationTray::DisableAnimationsForTest(false);
NotificationTray::DisableAnimationsForTest(false);
AshTestBase::TearDown();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "ash/system/web_notification/ash_popup_alignment_delegate.h"
#include "ash/system/message_center/ash_popup_alignment_delegate.h"

#include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/shell_window_ids.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_
#define ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_
#ifndef ASH_SYSTEM_MESSAGE_CENTER_ASH_POPUP_ALIGNMENT_DELEGATE_H_
#define ASH_SYSTEM_MESSAGE_CENTER_ASH_POPUP_ALIGNMENT_DELEGATE_H_

#include <stdint.h>

Expand All @@ -24,7 +24,7 @@ namespace ash {

class AshPopupAlignmentDelegateTest;
class Shelf;
class WebNotificationTrayTest;
class NotificationTrayTest;

// The PopupAlignmentDelegate subclass for Ash. It needs to handle alignment of
// the shelf and its autohide state.
Expand Down Expand Up @@ -61,7 +61,7 @@ class ASH_EXPORT AshPopupAlignmentDelegate

private:
friend class AshPopupAlignmentDelegateTest;
friend class WebNotificationTrayTest;
friend class NotificationTrayTest;

// Get the current alignment of the shelf.
ShelfAlignment GetAlignment() const;
Expand Down Expand Up @@ -92,4 +92,4 @@ class ASH_EXPORT AshPopupAlignmentDelegate

} // namespace ash

#endif // ASH_SYSTEM_WEB_NOTIFICATION_ASH_POPUP_ALIGNMENT_DELEGATE_H_
#endif // ASH_SYSTEM_MESSAGE_CENTER_ASH_POPUP_ALIGNMENT_DELEGATE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -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 "ash/system/web_notification/ash_popup_alignment_delegate.h"
#include "ash/system/message_center/ash_popup_alignment_delegate.h"

#include <memory>
#include <utility>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "ash/system/web_notification/fullscreen_notification_blocker.h"
#include "ash/system/message_center/fullscreen_notification_blocker.h"

#include "ash/root_window_controller.h"
#include "ash/shell.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_SYSTEM_WEB_NOTIFICATION_FULLSCREEN_NOTIFICATION_BLOCKER_H_
#define ASH_SYSTEM_WEB_NOTIFICATION_FULLSCREEN_NOTIFICATION_BLOCKER_H_
#ifndef ASH_SYSTEM_MESSAGE_CENTER_FULLSCREEN_NOTIFICATION_BLOCKER_H_
#define ASH_SYSTEM_MESSAGE_CENTER_FULLSCREEN_NOTIFICATION_BLOCKER_H_

#include "ash/shell_observer.h"
#include "base/macros.h"
Expand Down Expand Up @@ -36,4 +36,4 @@ class FullscreenNotificationBlocker

} // namespace ash

#endif // ASH_SYSTEM_WEB_NOTIFICATION_FULLSCREEN_NOTIFICATION_BLOCKER_H_
#endif // ASH_SYSTEM_MESSAGE_CENTER_FULLSCREEN_NOTIFICATION_BLOCKER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -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 "ash/system/web_notification/inactive_user_notification_blocker.h"
#include "ash/system/message_center/inactive_user_notification_blocker.h"

#include "ash/session/session_controller.h"
#include "ash/shell.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_SYSTEM_WEB_NOTIFICATION_INACTIVE_USER_NOTIFICATION_BLOCKER_H_
#define ASH_SYSTEM_WEB_NOTIFICATION_INACTIVE_USER_NOTIFICATION_BLOCKER_H_
#ifndef ASH_SYSTEM_MESSAGE_CENTER_INACTIVE_USER_NOTIFICATION_BLOCKER_H_
#define ASH_SYSTEM_MESSAGE_CENTER_INACTIVE_USER_NOTIFICATION_BLOCKER_H_

#include <map>

Expand Down Expand Up @@ -43,4 +43,4 @@ class ASH_EXPORT InactiveUserNotificationBlocker

} // namespace ash

#endif // ASH_SYSTEM_WEB_NOTIFICATION_INACTIVE_USER_NOTIFICATION_BLOCKER_H_
#endif // ASH_SYSTEM_MESSAGE_CENTER_INACTIVE_USER_NOTIFICATION_BLOCKER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -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 "ash/system/web_notification/inactive_user_notification_blocker.h"
#include "ash/system/message_center/inactive_user_notification_blocker.h"

#include "ash/message_center/message_center_controller.h"
#include "ash/session/test_session_controller_client.h"
Expand Down
Loading

0 comments on commit 522710a

Please sign in to comment.