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

Unified Diff: athena/home/home_card_impl.cc

Issue 455543004: Use ShadowController instead of creating its own. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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 | « no previous file | athena/wm/window_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/home_card_impl.cc
diff --git a/athena/home/home_card_impl.cc b/athena/home/home_card_impl.cc
index e5e4055f0f4e611f48e23644831759d3e2e5cd22..c1908de0563b43dfd0908a0e6877b128df278f8f 100644
--- a/athena/home/home_card_impl.cc
+++ b/athena/home/home_card_impl.cc
@@ -26,7 +26,7 @@
#include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
-#include "ui/wm/core/shadow.h"
+#include "ui/wm/core/shadow_types.h"
#include "ui/wm/core/visibility_controller.h"
#include "ui/wm/core/window_animations.h"
#include "ui/wm/public/activation_change_observer.h"
@@ -291,12 +291,10 @@ class HomeCardView : public views::WidgetDelegateView {
contents_view->SetActivePage(contents_view->GetPageIndexForNamedPage(
app_list::ContentsView::NAMED_PAGE_START));
}
-
- if (state == HomeCard::VISIBLE_MINIMIZED)
- shadow_.reset();
- // Do not create the shadow yet. Instead, create it in OnWidgetMove(), to
- // make sure that widget has been resized correctly (because the size of the
- // shadow depends on the size of the widget).
+ wm::SetShadowType(GetWidget()->GetNativeView(),
+ state == HomeCard::VISIBLE_MINIMIZED ?
+ wm::SHADOW_TYPE_NONE :
+ wm::SHADOW_TYPE_RECTANGULAR);
}
void ClearGesture() {
@@ -329,24 +327,6 @@ class HomeCardView : public views::WidgetDelegateView {
}
private:
- // views::WidgetDelegate:
- virtual void OnWidgetMove() OVERRIDE {
- if (!minimized_view_->visible()) {
- aura::Window* window = GetWidget()->GetNativeWindow();
- if (!shadow_) {
- shadow_.reset(new wm::Shadow());
- shadow_->Init(wm::Shadow::STYLE_ACTIVE);
- shadow_->SetContentBounds(gfx::Rect(window->bounds().size()));
- shadow_->layer()->SetVisible(true);
-
- ui::Layer* layer = window->layer();
- layer->Add(shadow_->layer());
- } else {
- shadow_->SetContentBounds(gfx::Rect(window->bounds().size()));
- }
- }
- }
-
virtual views::View* GetContentsView() OVERRIDE {
return this;
}
@@ -354,7 +334,6 @@ class HomeCardView : public views::WidgetDelegateView {
app_list::AppListMainView* main_view_;
BottomHomeView* bottom_view_;
views::View* minimized_view_;
- scoped_ptr<wm::Shadow> shadow_;
scoped_ptr<HomeCardGestureManager> gesture_manager_;
HomeCardGestureManager::Delegate* gesture_delegate_;
« no previous file with comments | « no previous file | athena/wm/window_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698