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

Unified Diff: ash/common/system/chromeos/tray_tracing.cc

Issue 2732813002: chromeos: Move files in //ash/common to //ash, part 1 (Closed)
Patch Set: rebase Created 3 years, 9 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
Index: ash/common/system/chromeos/tray_tracing.cc
diff --git a/ash/common/system/chromeos/tray_tracing.cc b/ash/common/system/chromeos/tray_tracing.cc
deleted file mode 100644
index cce4bce5dedd474d86f5e4397adc01a207f64da5..0000000000000000000000000000000000000000
--- a/ash/common/system/chromeos/tray_tracing.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2013 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/chromeos/tray_tracing.h"
-
-#include "ash/common/metrics/user_metrics_action.h"
-#include "ash/common/system/tray/actionable_view.h"
-#include "ash/common/system/tray/fixed_sized_image_view.h"
-#include "ash/common/system/tray/system_tray.h"
-#include "ash/common/system/tray/system_tray_controller.h"
-#include "ash/common/system/tray/system_tray_notifier.h"
-#include "ash/common/system/tray/tray_constants.h"
-#include "ash/common/system/tray/tray_popup_item_style.h"
-#include "ash/common/system/tray/tray_popup_utils.h"
-#include "ash/common/system/tray/tri_view.h"
-#include "ash/common/wm_shell.h"
-#include "ash/resources/vector_icons/vector_icons.h"
-#include "ash/strings/grit/ash_strings.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/gfx/image/image.h"
-#include "ui/gfx/paint_vector_icon.h"
-#include "ui/views/controls/image_view.h"
-#include "ui/views/controls/label.h"
-#include "ui/views/layout/fill_layout.h"
-
-namespace ash {
-namespace tray {
-
-class DefaultTracingView : public ActionableView {
- public:
- explicit DefaultTracingView(SystemTrayItem* owner)
- : ActionableView(owner, TrayPopupInkDropStyle::FILL_BOUNDS) {
- SetLayoutManager(new views::FillLayout);
- TriView* tri_view = TrayPopupUtils::CreateDefaultRowView();
- AddChildView(tri_view);
-
- auto* image = TrayPopupUtils::CreateMainImageView();
- tri_view->AddView(TriView::Container::START, image);
-
- auto* label = TrayPopupUtils::CreateDefaultLabel();
- label->SetMultiLine(true);
- label->SetText(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_TRACING));
- tri_view->AddView(TriView::Container::CENTER, label);
-
- TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
- style.SetupLabel(label);
- image->SetImage(
- gfx::CreateVectorIcon(kSystemMenuTracingIcon, style.GetIconColor()));
-
- SetInkDropMode(InkDropHostView::InkDropMode::ON);
- }
-
- ~DefaultTracingView() override {}
-
- private:
- bool PerformAction(const ui::Event& event) override {
- WmShell::Get()->RecordUserMetricsAction(
- UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED);
- WmShell::Get()->system_tray_controller()->ShowChromeSlow();
- CloseSystemBubble();
- return true;
- }
-
- DISALLOW_COPY_AND_ASSIGN(DefaultTracingView);
-};
-
-} // namespace tray
-
-////////////////////////////////////////////////////////////////////////////////
-// ash::TrayTracing
-
-TrayTracing::TrayTracing(SystemTray* system_tray)
- : TrayImageItem(system_tray, kSystemTrayTracingIcon, UMA_TRACING),
- default_(nullptr) {
- DCHECK(system_tray);
- WmShell::Get()->system_tray_notifier()->AddTracingObserver(this);
-}
-
-TrayTracing::~TrayTracing() {
- WmShell::Get()->system_tray_notifier()->RemoveTracingObserver(this);
-}
-
-void TrayTracing::SetTrayIconVisible(bool visible) {
- if (tray_view())
- tray_view()->SetVisible(visible);
-}
-
-bool TrayTracing::GetInitialVisibility() {
- return false;
-}
-
-views::View* TrayTracing::CreateDefaultView(LoginStatus status) {
- CHECK(default_ == NULL);
- if (tray_view() && tray_view()->visible())
- default_ = new tray::DefaultTracingView(this);
- return default_;
-}
-
-views::View* TrayTracing::CreateDetailedView(LoginStatus status) {
- return NULL;
-}
-
-void TrayTracing::DestroyDefaultView() {
- default_ = NULL;
-}
-
-void TrayTracing::DestroyDetailedView() {}
-
-void TrayTracing::OnTracingModeChanged(bool value) {
- SetTrayIconVisible(value);
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/system/chromeos/tray_tracing.h ('k') | ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698