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

Side by Side Diff: ash/wm/modal_container_layout_manager.cc

Issue 9166014: Allow a Views client to provide a default frameview for window widgets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/dialog_frame_view.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/modal_container_layout_manager.h" 5 #include "ash/wm/modal_container_layout_manager.h"
6 6
7 #include "ash/ash_switches.h"
7 #include "ash/shell.h" 8 #include "ash/shell.h"
8 #include "ash/wm/modality_event_filter.h" 9 #include "ash/wm/modality_event_filter.h"
9 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
10 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h"
11 #include "ui/aura/client/aura_constants.h" 13 #include "ui/aura/client/aura_constants.h"
12 #include "ui/aura/event.h" 14 #include "ui/aura/event.h"
13 #include "ui/aura/root_window.h" 15 #include "ui/aura/root_window.h"
14 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
15 #include "ui/gfx/canvas.h" 17 #include "ui/gfx/canvas.h"
16 #include "ui/gfx/compositor/layer.h" 18 #include "ui/gfx/compositor/layer.h"
17 #include "ui/gfx/compositor/layer_animator.h" 19 #include "ui/gfx/compositor/layer_animator.h"
18 #include "ui/views/view.h" 20 #include "ui/views/view.h"
19 #include "ui/views/widget/widget.h" 21 #include "ui/views/widget/widget.h"
20 22
21 namespace ash { 23 namespace ash {
22 namespace internal { 24 namespace internal {
23 25
24 namespace { 26 namespace {
25 27
26 class ScreenView : public views::View { 28 class ScreenView : public views::View {
27 public: 29 public:
28 ScreenView() {} 30 ScreenView() {}
29 virtual ~ScreenView() {} 31 virtual ~ScreenView() {}
30 32
31 // Overridden from views::View: 33 // Overridden from views::View:
32 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { 34 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
33 canvas->FillRect(SK_ColorBLACK, GetLocalBounds()); 35 canvas->FillRect(GetOverlayColor(), GetLocalBounds());
34 } 36 }
35 37
36 private: 38 private:
39 SkColor GetOverlayColor() {
40 if (CommandLine::ForCurrentProcess()->HasSwitch(
41 switches::kAuraGoogleDialogFrames)) {
42 return SK_ColorWHITE;
43 }
44 return SK_ColorBLACK;
45 }
46
37 DISALLOW_COPY_AND_ASSIGN(ScreenView); 47 DISALLOW_COPY_AND_ASSIGN(ScreenView);
38 }; 48 };
39 49
40 } // namespace 50 } // namespace
41 51
42 //////////////////////////////////////////////////////////////////////////////// 52 ////////////////////////////////////////////////////////////////////////////////
43 // ModalContainerLayoutManager, public: 53 // ModalContainerLayoutManager, public:
44 54
45 ModalContainerLayoutManager::ModalContainerLayoutManager( 55 ModalContainerLayoutManager::ModalContainerLayoutManager(
46 aura::Window* container) 56 aura::Window* container)
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 191
182 void ModalContainerLayoutManager::HideModalScreen() { 192 void ModalContainerLayoutManager::HideModalScreen() {
183 Shell::GetInstance()->RemoveRootWindowEventFilter(modality_filter_.get()); 193 Shell::GetInstance()->RemoveRootWindowEventFilter(modality_filter_.get());
184 ui::LayerAnimator::ScopedSettings settings( 194 ui::LayerAnimator::ScopedSettings settings(
185 modal_screen_->GetNativeView()->layer()->GetAnimator()); 195 modal_screen_->GetNativeView()->layer()->GetAnimator());
186 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); 196 modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f);
187 } 197 }
188 198
189 } // namespace internal 199 } // namespace internal
190 } // namespace ash 200 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/dialog_frame_view.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698