| 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/shelf/app_list_button.h" | 7 #include "ash/common/shelf/app_list_button.h" |
| 8 #include "ash/common/shelf/shelf_widget.h" | 8 #include "ash/common/shelf/shelf_widget.h" |
| 9 #include "ash/common/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
| 10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
| 11 #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" | 12 #include "ash/common/wm_shell.h" |
| 14 #include "ash/common/wm_window.h" | 13 #include "ash/common/wm_window.h" |
| 15 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 16 #include "base/logging.h" | 15 #include "base/logging.h" |
| 17 #include "ui/app_list/views/app_list_view.h" | 16 #include "ui/app_list/views/app_list_view.h" |
| 18 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 19 #include "ui/display/display.h" | 18 #include "ui/display/display.h" |
| 20 #include "ui/display/screen.h" | 19 #include "ui/display/screen.h" |
| 21 #include "ui/gfx/geometry/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
| 22 #include "ui/views/view.h" | 21 #include "ui/views/view.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 50 if (IsTrayBubbleOpened()) | 49 if (IsTrayBubbleOpened()) |
| 51 CloseTrayBubble(); | 50 CloseTrayBubble(); |
| 52 widget_->Close(); | 51 widget_->Close(); |
| 53 } | 52 } |
| 54 | 53 |
| 55 views::Widget* FirstRunHelperImpl::GetOverlayWidget() { | 54 views::Widget* FirstRunHelperImpl::GetOverlayWidget() { |
| 56 return widget_; | 55 return widget_; |
| 57 } | 56 } |
| 58 | 57 |
| 59 gfx::Rect FirstRunHelperImpl::GetAppListButtonBounds() { | 58 gfx::Rect FirstRunHelperImpl::GetAppListButtonBounds() { |
| 60 WmShelf* shelf = WmShell::Get() | 59 WmShelf* shelf = WmShelf::ForWindow(WmShell::Get()->GetPrimaryRootWindow()); |
| 61 ->GetPrimaryRootWindow() | |
| 62 ->GetRootWindowController() | |
| 63 ->GetShelf(); | |
| 64 AppListButton* app_button = shelf->shelf_widget()->GetAppListButton(); | 60 AppListButton* app_button = shelf->shelf_widget()->GetAppListButton(); |
| 65 return app_button->GetBoundsInScreen(); | 61 return app_button->GetBoundsInScreen(); |
| 66 } | 62 } |
| 67 | 63 |
| 68 void FirstRunHelperImpl::Cancel() { | 64 void FirstRunHelperImpl::Cancel() { |
| 69 FOR_EACH_OBSERVER(Observer, observers(), OnCancelled()); | 65 FOR_EACH_OBSERVER(Observer, observers(), OnCancelled()); |
| 70 } | 66 } |
| 71 | 67 |
| 72 bool FirstRunHelperImpl::IsCancelingKeyEvent(ui::KeyEvent* event) { | 68 bool FirstRunHelperImpl::IsCancelingKeyEvent(ui::KeyEvent* event) { |
| 73 return event->key_code() == ui::VKEY_ESCAPE; | 69 return event->key_code() == ui::VKEY_ESCAPE; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 99 return bubble->GetBoundsInScreen(); | 95 return bubble->GetBoundsInScreen(); |
| 100 } | 96 } |
| 101 | 97 |
| 102 gfx::Rect FirstRunHelperImpl::GetHelpButtonBounds() { | 98 gfx::Rect FirstRunHelperImpl::GetHelpButtonBounds() { |
| 103 SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray(); | 99 SystemTray* tray = Shell::GetInstance()->GetPrimarySystemTray(); |
| 104 views::View* help_button = tray->GetHelpButtonView(); | 100 views::View* help_button = tray->GetHelpButtonView(); |
| 105 return help_button->GetBoundsInScreen(); | 101 return help_button->GetBoundsInScreen(); |
| 106 } | 102 } |
| 107 | 103 |
| 108 } // namespace ash | 104 } // namespace ash |
| OLD | NEW |