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

Unified Diff: ash/wm/system_modal_container_layout_manager.cc

Issue 11565019: Consolidate dialog style flags and strings; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Alphabetize IDS strings. Created 8 years 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/wm/system_modal_container_layout_manager.cc
diff --git a/ash/wm/system_modal_container_layout_manager.cc b/ash/wm/system_modal_container_layout_manager.cc
index 6d1a07576e075451afa35569ad0057b75e4a48f9..192d5ab726db1cea8d629612fa14bbd750cf9182 100644
--- a/ash/wm/system_modal_container_layout_manager.cc
+++ b/ash/wm/system_modal_container_layout_manager.cc
@@ -4,7 +4,6 @@
#include "ash/wm/system_modal_container_layout_manager.h"
-#include "ash/ash_switches.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
@@ -19,10 +18,10 @@
#include "ui/views/corewm/compound_event_filter.h"
#include "ui/aura/window.h"
#include "ui/base/events/event.h"
+#include "ui/base/ui_base_switches.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animator.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
-#include "ui/gfx/canvas.h"
#include "ui/gfx/screen.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
@@ -30,32 +29,6 @@
namespace ash {
namespace internal {
-namespace {
-
-class ModalBackgroundView : public views::View {
- public:
- ModalBackgroundView() {}
- virtual ~ModalBackgroundView() {}
-
- // Overridden from views::View:
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
- canvas->FillRect(GetLocalBounds(), GetOverlayColor());
- }
-
- private:
- SkColor GetOverlayColor() {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAuraGoogleDialogFrames)) {
- return SK_ColorWHITE;
- }
- return SK_ColorBLACK;
- }
-
- DISALLOW_COPY_AND_ASSIGN(ModalBackgroundView);
-};
-
-} // namespace
-
////////////////////////////////////////////////////////////////////////////////
// SystemModalContainerLayoutManager, public:
@@ -188,7 +161,11 @@ void SystemModalContainerLayoutManager::CreateModalBackground() {
modal_background_->Init(params);
modal_background_->GetNativeView()->SetName(
"SystemModalContainerLayoutManager.ModalBackground");
- modal_background_->SetContentsView(new ModalBackgroundView);
+ views::View* contents_view = new views::View();
+ contents_view->set_background(views::Background::CreateSolidBackground(
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableNewDialogStyle) ? SK_ColorWHITE : SK_ColorBLACK));
+ modal_background_->SetContentsView(contents_view);
modal_background_->GetNativeView()->layer()->SetOpacity(0.0f);
}

Powered by Google App Engine
This is Rietveld 408576698