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

Side by Side Diff: ash/desktop_background/desktop_background_view.cc

Issue 11092034: Add Wallpaper option to launcher context menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace, Null Check, Comment Update Created 8 years, 2 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/ash.gyp ('k') | ash/launcher/launcher.h » ('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) 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 (height() - wallpaper.height()) / 2); 145 (height() - wallpaper.height()) / 2);
146 } 146 }
147 } 147 }
148 148
149 bool DesktopBackgroundView::OnMousePressed(const ui::MouseEvent& event) { 149 bool DesktopBackgroundView::OnMousePressed(const ui::MouseEvent& event) {
150 return true; 150 return true;
151 } 151 }
152 152
153 void DesktopBackgroundView::ShowContextMenuForView(views::View* source, 153 void DesktopBackgroundView::ShowContextMenuForView(views::View* source,
154 const gfx::Point& point) { 154 const gfx::Point& point) {
155 Shell::GetInstance()->ShowBackgroundMenu(GetWidget(), point); 155 Shell::GetInstance()->ShowContextMenu(point);
156 } 156 }
157 157
158 views::Widget* CreateDesktopBackground(aura::RootWindow* root_window, 158 views::Widget* CreateDesktopBackground(aura::RootWindow* root_window,
159 int container_id) { 159 int container_id) {
160 DesktopBackgroundController* controller = 160 DesktopBackgroundController* controller =
161 ash::Shell::GetInstance()->desktop_background_controller(); 161 ash::Shell::GetInstance()->desktop_background_controller();
162 views::Widget* desktop_widget = new views::Widget; 162 views::Widget* desktop_widget = new views::Widget;
163 views::Widget::InitParams params( 163 views::Widget::InitParams params(
164 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 164 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
165 if (controller->GetWallpaper().isNull()) 165 if (controller->GetWallpaper().isNull())
(...skipping 22 matching lines...) Expand all
188 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); 188 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
189 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window, 189 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window,
190 desktop_widget)); 190 desktop_widget));
191 desktop_widget->Show(); 191 desktop_widget->Show();
192 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); 192 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView");
193 return desktop_widget; 193 return desktop_widget;
194 } 194 }
195 195
196 } // namespace internal 196 } // namespace internal
197 } // namespace ash 197 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/launcher/launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698