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

Unified Diff: ui/app_list/views/app_list_view.cc

Issue 306023011: Add new DialogDelegate for dialogs in the App List (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit comment Created 6 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 | « ui/app_list/views/app_list_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_view.cc
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index 784abab063db2b67e7a38d344aa3341691b36835..edbe25259cc54a48d43f32eadb879a927cf01761 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -25,7 +25,6 @@
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_observer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
-#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/path.h"
@@ -76,28 +75,6 @@ bool SupportsShadow() {
return true;
}
-// The background for the App List overlay, which appears as a white rounded
-// rectangle with the given radius and the same size as the target view.
-class AppListOverlayBackground : public views::Background {
- public:
- AppListOverlayBackground(int corner_radius)
- : corner_radius_(corner_radius) {};
- virtual ~AppListOverlayBackground() {};
-
- // Overridden from views::Background:
- virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE {
- SkPaint paint;
- paint.setStyle(SkPaint::kFill_Style);
- paint.setColor(SK_ColorWHITE);
- canvas->DrawRoundRect(view->GetContentsBounds(), corner_radius_, paint);
- }
-
- private:
- const int corner_radius_;
-
- DISALLOW_COPY_AND_ASSIGN(AppListOverlayBackground);
-};
-
} // namespace
// An animation observer to hide the view at the end of the animation.
@@ -146,7 +123,6 @@ AppListView::AppListView(AppListViewDelegate* delegate)
: delegate_(delegate),
app_list_main_view_(NULL),
speech_view_(NULL),
- overlay_view_(NULL),
animation_observer_(new HideViewAnimationObserver()) {
CHECK(delegate);
@@ -214,11 +190,6 @@ void AppListView::UpdateBounds() {
SizeToContents();
}
-void AppListView::SetAppListOverlayVisible(bool visible) {
- DCHECK(overlay_view_);
- overlay_view_->SetVisible(visible);
-}
-
bool AppListView::ShouldCenterWindow() const {
return delegate_->ShouldCenterWindow();
}
@@ -346,28 +317,6 @@ void AppListView::InitAsBubbleInternal(gfx::NativeView parent,
GetWidget()->Hide();
#endif
- // To make the overlay view, construct a view with a white background, rather
- // than a white rectangle in it. This is because we need overlay_view_ to be
- // drawn to its own layer (so it appears correctly in the foreground).
- const float kOverlayOpacity = 0.75f;
- overlay_view_ = new views::View();
- overlay_view_->SetPaintToLayer(true);
- overlay_view_->layer()->SetOpacity(kOverlayOpacity);
- overlay_view_->SetBoundsRect(GetContentsBounds());
- overlay_view_->SetVisible(false);
-
- // On platforms that don't support a shadow, the rounded border of the app
- // list is constructed _inside_ the view, so a rectangular background goes
- // over the border in the rounded corners. To fix this, give the background a
- // corner radius 1px smaller than the outer border, so it just reaches but
- // doesn't cover it.
- const int kOverlayCornerRadius =
- GetBubbleFrameView()->bubble_border()->GetBorderCornerRadius();
- overlay_view_->set_background(new AppListOverlayBackground(
- kOverlayCornerRadius - (SupportsShadow() ? 0 : 1)));
-
- AddChildView(overlay_view_);
-
if (delegate_)
delegate_->ViewInitialized();
}
« no previous file with comments | « ui/app_list/views/app_list_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698