OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/first_run/first_run_helper_impl.h" | 5 #include "ash/first_run/first_run_helper_impl.h" |
6 | 6 |
7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 29 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
30 params.parent = Shell::GetContainer(Shell::GetPrimaryRootWindow(), | 30 params.parent = Shell::GetContainer(Shell::GetPrimaryRootWindow(), |
31 ash::kShellWindowId_OverlayContainer); | 31 ash::kShellWindowId_OverlayContainer); |
32 views::Widget* window = new views::Widget; | 32 views::Widget* window = new views::Widget; |
33 window->Init(params); | 33 window->Init(params); |
34 return window; | 34 return window; |
35 } | 35 } |
36 | 36 |
37 } // anonymous namespace | 37 } // anonymous namespace |
38 | 38 |
39 FirstRunHelperImpl::FirstRunHelperImpl() | 39 FirstRunHelperImpl::FirstRunHelperImpl() : widget_(CreateFirstRunWindow()) { |
40 : widget_(CreateFirstRunWindow()) { | |
41 Shell::GetInstance()->overlay_filter()->Activate(this); | 40 Shell::GetInstance()->overlay_filter()->Activate(this); |
42 } | 41 } |
43 | 42 |
44 FirstRunHelperImpl::~FirstRunHelperImpl() { | 43 FirstRunHelperImpl::~FirstRunHelperImpl() { |
45 Shell::GetInstance()->overlay_filter()->Deactivate(this); | 44 Shell::GetInstance()->overlay_filter()->Deactivate(this); |
46 if (IsTrayBubbleOpened()) | 45 if (IsTrayBubbleOpened()) |
47 CloseTrayBubble(); | 46 CloseTrayBubble(); |
48 widget_->Close(); | 47 widget_->Close(); |
49 } | 48 } |
50 | 49 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 return bubble->GetBoundsInScreen(); | 91 return bubble->GetBoundsInScreen(); |
93 } | 92 } |
94 | 93 |
95 gfx::Rect FirstRunHelperImpl::GetHelpButtonBounds() { | 94 gfx::Rect FirstRunHelperImpl::GetHelpButtonBounds() { |
96 SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray(); | 95 SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray(); |
97 views::View* help_button = tray->GetHelpButtonView(); | 96 views::View* help_button = tray->GetHelpButtonView(); |
98 return help_button->GetBoundsInScreen(); | 97 return help_button->GetBoundsInScreen(); |
99 } | 98 } |
100 | 99 |
101 } // namespace ash | 100 } // namespace ash |
OLD | NEW |