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

Unified Diff: ash/devtools/widget_element.cc

Issue 2899783002: Move DevTools out of ash and turn it to a component. (Closed)
Patch Set: add README.md Created 3 years, 6 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/devtools/widget_element.h ('k') | ash/devtools/window_element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/devtools/widget_element.cc
diff --git a/ash/devtools/widget_element.cc b/ash/devtools/widget_element.cc
deleted file mode 100644
index ec07a1f7d2b75b90fec6a8bb9d13e6a39a66a70e..0000000000000000000000000000000000000000
--- a/ash/devtools/widget_element.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2017 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/devtools/widget_element.h"
-
-#include "ash/devtools/ui_element_delegate.h"
-
-namespace ash {
-namespace devtools {
-
-WidgetElement::WidgetElement(views::Widget* widget,
- UIElementDelegate* ui_element_delegate,
- UIElement* parent)
- : UIElement(UIElementType::WIDGET, ui_element_delegate, parent),
- widget_(widget) {
- widget_->AddRemovalsObserver(this);
-}
-
-WidgetElement::~WidgetElement() {
- widget_->RemoveRemovalsObserver(this);
-}
-
-void WidgetElement::OnWillRemoveView(views::Widget* widget, views::View* view) {
- if (view != widget->GetRootView())
- return;
- DCHECK_EQ(1u, children().size());
- UIElement* child = children()[0];
- RemoveChild(child);
- delete child;
-}
-
-void WidgetElement::OnWidgetBoundsChanged(views::Widget* widget,
- const gfx::Rect& new_bounds) {
- DCHECK_EQ(widget, widget_);
- delegate()->OnUIElementBoundsChanged(this);
-}
-
-void WidgetElement::GetBounds(gfx::Rect* bounds) const {
- *bounds = widget_->GetRestoredBounds();
-}
-
-void WidgetElement::SetBounds(const gfx::Rect& bounds) {
- widget_->SetBounds(bounds);
-}
-
-void WidgetElement::GetVisible(bool* visible) const {
- *visible = widget_->IsVisible();
-}
-
-void WidgetElement::SetVisible(bool visible) {
- if (visible == widget_->IsVisible())
- return;
- if (visible)
- widget_->Show();
- else
- widget_->Hide();
-}
-
-std::pair<aura::Window*, gfx::Rect> WidgetElement::GetNodeWindowAndBounds()
- const {
- return std::make_pair(widget_->GetNativeWindow(),
- widget_->GetWindowBoundsInScreen());
-}
-
-// static
-views::Widget* WidgetElement::From(UIElement* element) {
- DCHECK_EQ(UIElementType::WIDGET, element->type());
- return static_cast<WidgetElement*>(element)->widget_;
-}
-
-} // namespace devtools
-} // namespace ash
« no previous file with comments | « ash/devtools/widget_element.h ('k') | ash/devtools/window_element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698