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

Side by Side Diff: ash/first_run/first_run_helper_impl.cc

Issue 2288993002: ash: Move AppList support to ShelfWidget, expose ShelfWidget in WmShelf (Closed)
Patch Set: missed one unit test Created 4 years, 3 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
« no previous file with comments | « ash/common/shelf/wm_shelf.cc ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('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 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/shelf/app_list_button.h" 7 #include "ash/common/shelf/app_list_button.h"
8 #include "ash/common/shelf/shelf.h" 8 #include "ash/common/shelf/shelf_widget.h"
9 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/shell_window_ids.h" 10 #include "ash/common/shell_window_ids.h"
10 #include "ash/common/system/tray/system_tray.h" 11 #include "ash/common/system/tray/system_tray.h"
12 #include "ash/common/wm_root_window_controller.h"
13 #include "ash/common/wm_shell.h"
14 #include "ash/common/wm_window.h"
11 #include "ash/shell.h" 15 #include "ash/shell.h"
12 #include "base/logging.h" 16 #include "base/logging.h"
13 #include "ui/app_list/views/app_list_view.h" 17 #include "ui/app_list/views/app_list_view.h"
14 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
15 #include "ui/display/display.h" 19 #include "ui/display/display.h"
16 #include "ui/display/screen.h" 20 #include "ui/display/screen.h"
17 #include "ui/gfx/geometry/rect.h" 21 #include "ui/gfx/geometry/rect.h"
18 #include "ui/views/view.h" 22 #include "ui/views/view.h"
19 #include "ui/views/widget/widget.h" 23 #include "ui/views/widget/widget.h"
20 24
(...skipping 25 matching lines...) Expand all
46 if (IsTrayBubbleOpened()) 50 if (IsTrayBubbleOpened())
47 CloseTrayBubble(); 51 CloseTrayBubble();
48 widget_->Close(); 52 widget_->Close();
49 } 53 }
50 54
51 views::Widget* FirstRunHelperImpl::GetOverlayWidget() { 55 views::Widget* FirstRunHelperImpl::GetOverlayWidget() {
52 return widget_; 56 return widget_;
53 } 57 }
54 58
55 gfx::Rect FirstRunHelperImpl::GetAppListButtonBounds() { 59 gfx::Rect FirstRunHelperImpl::GetAppListButtonBounds() {
56 Shelf* shelf = Shelf::ForPrimaryDisplay(); 60 WmShelf* shelf = WmShell::Get()
57 AppListButton* app_button = shelf->GetAppListButton(); 61 ->GetPrimaryRootWindow()
62 ->GetRootWindowController()
63 ->GetShelf();
64 AppListButton* app_button = shelf->shelf_widget()->GetAppListButton();
58 return app_button->GetBoundsInScreen(); 65 return app_button->GetBoundsInScreen();
59 } 66 }
60 67
61 void FirstRunHelperImpl::Cancel() { 68 void FirstRunHelperImpl::Cancel() {
62 FOR_EACH_OBSERVER(Observer, observers(), OnCancelled()); 69 FOR_EACH_OBSERVER(Observer, observers(), OnCancelled());
63 } 70 }
64 71
65 bool FirstRunHelperImpl::IsCancelingKeyEvent(ui::KeyEvent* event) { 72 bool FirstRunHelperImpl::IsCancelingKeyEvent(ui::KeyEvent* event) {
66 return event->key_code() == ui::VKEY_ESCAPE; 73 return event->key_code() == ui::VKEY_ESCAPE;
67 } 74 }
(...skipping 24 matching lines...) Expand all
92 return bubble->GetBoundsInScreen(); 99 return bubble->GetBoundsInScreen();
93 } 100 }
94 101
95 gfx::Rect FirstRunHelperImpl::GetHelpButtonBounds() { 102 gfx::Rect FirstRunHelperImpl::GetHelpButtonBounds() {
96 SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray(); 103 SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray();
97 views::View* help_button = tray->GetHelpButtonView(); 104 views::View* help_button = tray->GetHelpButtonView();
98 return help_button->GetBoundsInScreen(); 105 return help_button->GetBoundsInScreen();
99 } 106 }
100 107
101 } // namespace ash 108 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/wm_shelf.cc ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698