OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/desktop_background/desktop_background_view.h" | 5 #include "ash/desktop_background/desktop_background_view.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // All other are simply centered, and not scaled (but may be clipped). | 163 // All other are simply centered, and not scaled (but may be clipped). |
164 canvas->DrawImageInt(wallpaper, (width() - wallpaper.width()) / 2, | 164 canvas->DrawImageInt(wallpaper, (width() - wallpaper.width()) / 2, |
165 (height() - wallpaper.height()) / 2); | 165 (height() - wallpaper.height()) / 2); |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 bool DesktopBackgroundView::OnMousePressed(const ui::MouseEvent& event) { | 169 bool DesktopBackgroundView::OnMousePressed(const ui::MouseEvent& event) { |
170 return true; | 170 return true; |
171 } | 171 } |
172 | 172 |
173 void DesktopBackgroundView::ShowContextMenuForView(views::View* source, | 173 void DesktopBackgroundView::ShowContextMenuForView( |
174 const gfx::Point& point) { | 174 views::View* source, |
175 Shell::GetInstance()->ShowContextMenu(point); | 175 const gfx::Point& point, |
| 176 ui::MenuSourceType source_type) { |
| 177 Shell::GetInstance()->ShowContextMenu(point, source_type); |
176 } | 178 } |
177 | 179 |
178 views::Widget* CreateDesktopBackground(aura::RootWindow* root_window, | 180 views::Widget* CreateDesktopBackground(aura::RootWindow* root_window, |
179 int container_id) { | 181 int container_id) { |
180 DesktopBackgroundController* controller = | 182 DesktopBackgroundController* controller = |
181 ash::Shell::GetInstance()->desktop_background_controller(); | 183 ash::Shell::GetInstance()->desktop_background_controller(); |
182 ash::UserWallpaperDelegate* wallpaper_delegate = | 184 ash::UserWallpaperDelegate* wallpaper_delegate = |
183 ash::Shell::GetInstance()->user_wallpaper_delegate(); | 185 ash::Shell::GetInstance()->user_wallpaper_delegate(); |
184 | 186 |
185 views::Widget* desktop_widget = new views::Widget; | 187 views::Widget* desktop_widget = new views::Widget; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 settings.AddObserver(new ShowWallpaperAnimationObserver( | 219 settings.AddObserver(new ShowWallpaperAnimationObserver( |
218 root_window, desktop_widget, | 220 root_window, desktop_widget, |
219 wallpaper_delegate->ShouldShowInitialAnimation())); | 221 wallpaper_delegate->ShouldShowInitialAnimation())); |
220 desktop_widget->Show(); | 222 desktop_widget->Show(); |
221 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); | 223 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); |
222 return desktop_widget; | 224 return desktop_widget; |
223 } | 225 } |
224 | 226 |
225 } // namespace internal | 227 } // namespace internal |
226 } // namespace ash | 228 } // namespace ash |
OLD | NEW |