Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6164)

Unified Diff: ash/common/system/tray/tray_popup_item_container.cc

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/system/tray/tray_popup_item_container.h ('k') | ash/common/system/tray/tray_popup_item_style.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_popup_item_container.cc
diff --git a/ash/common/system/tray/tray_popup_item_container.cc b/ash/common/system/tray/tray_popup_item_container.cc
deleted file mode 100644
index 3a3d0d50dc08748d1be1715e0e82205a4fec67d6..0000000000000000000000000000000000000000
--- a/ash/common/system/tray/tray_popup_item_container.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/common/system/tray/tray_popup_item_container.h"
-
-#include "ash/common/system/tray/tray_constants.h"
-#include "ui/gfx/canvas.h"
-#include "ui/views/layout/box_layout.h"
-
-namespace ash {
-
-TrayPopupItemContainer::TrayPopupItemContainer(views::View* view,
- bool change_background)
- : active_(false), change_background_(change_background) {
- set_notify_enter_exit_on_child(true);
- views::BoxLayout* layout =
- new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
- layout->SetDefaultFlex(1);
- SetLayoutManager(layout);
- if (view->layer()) {
- SetPaintToLayer();
- layer()->SetFillsBoundsOpaquely(view->layer()->fills_bounds_opaquely());
- }
- AddChildView(view);
- SetVisible(view->visible());
-}
-
-TrayPopupItemContainer::~TrayPopupItemContainer() {}
-
-void TrayPopupItemContainer::SetActive(bool active) {
- if (!change_background_ || active_ == active)
- return;
- active_ = active;
- SchedulePaint();
-}
-
-void TrayPopupItemContainer::ChildVisibilityChanged(View* child) {
- if (visible() == child->visible())
- return;
- SetVisible(child->visible());
- PreferredSizeChanged();
-}
-
-void TrayPopupItemContainer::ChildPreferredSizeChanged(View* child) {
- PreferredSizeChanged();
-}
-
-void TrayPopupItemContainer::OnMouseEntered(const ui::MouseEvent& event) {
- SetActive(true);
-}
-
-void TrayPopupItemContainer::OnMouseExited(const ui::MouseEvent& event) {
- SetActive(false);
-}
-
-void TrayPopupItemContainer::OnGestureEvent(ui::GestureEvent* event) {
- if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
- SetActive(true);
- } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL ||
- event->type() == ui::ET_GESTURE_TAP) {
- SetActive(false);
- }
-}
-
-void TrayPopupItemContainer::OnPaintBackground(gfx::Canvas* canvas) {
- if (child_count() == 0)
- return;
-
- views::View* view = child_at(0);
- if (!view->background()) {
- canvas->FillRect(gfx::Rect(size()),
- (active_) ? kHoverBackgroundColor : kBackgroundColor);
- }
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/system/tray/tray_popup_item_container.h ('k') | ash/common/system/tray/tray_popup_item_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698