Chromium Code Reviews| 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/wm/workspace_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "ash/wm/workspace/workspace_event_filter.h" | 10 #include "ash/wm/workspace/workspace_event_filter.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 if (viewport_->layout_manager() == layout_manager_) | 51 if (viewport_->layout_manager() == layout_manager_) |
| 52 viewport_->SetLayoutManager(NULL); | 52 viewport_->SetLayoutManager(NULL); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void WorkspaceController::ToggleOverview() { | 55 void WorkspaceController::ToggleOverview() { |
| 56 workspace_manager_->SetOverview(!workspace_manager_->is_overview()); | 56 workspace_manager_->SetOverview(!workspace_manager_->is_overview()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void WorkspaceController::ShowMenu(views::Widget* widget, | 59 void WorkspaceController::ShowMenu(views::Widget* widget, |
| 60 const gfx::Point& location) { | 60 const gfx::Point& location) { |
| 61 // TODO(sky): move this. Since this menu is now specific to the background it | 61 // TODO(sky): move this. Since this menu is now specific to the background it |
|
sky
2012/04/05 03:48:14
Since this is targeted at m20, can you clean this
bshe
2012/04/05 15:42:31
Just to clarify, do you want to remove this in wor
bshe
2012/04/10 18:27:42
Done.
| |
| 62 // doesn't make sense to be here. | 62 // doesn't make sense to be here. |
| 63 #if !defined(OS_MACOSX) | 63 #if !defined(OS_MACOSX) |
| 64 ui::SimpleMenuModel menu_model(this); | 64 ui::SimpleMenuModel menu_model(this); |
| 65 // This is just for testing and will be ripped out before we ship, so none of | 65 // This is just for testing and will be ripped out before we ship, so none of |
| 66 // the strings are localized. | 66 // the strings are localized. |
| 67 menu_model.AddItem(MENU_CHANGE_WALLPAPER, | 67 if (!Shell::GetInstance()->user_wallpaper_delegate()->IsLoggedInAsGuest()) { |
|
sky
2012/04/05 03:48:14
If this is false, you'll show an empty menu. In th
bshe
2012/04/10 18:27:42
Done.
| |
| 68 l10n_util::GetStringUTF16(IDS_AURA_SET_DESKTOP_WALLPAPER)); | 68 menu_model.AddItem(MENU_CHANGE_WALLPAPER, |
| 69 l10n_util::GetStringUTF16(IDS_AURA_SET_DESKTOP_WALLPAPER)); | |
| 70 } | |
| 69 views::MenuModelAdapter menu_model_adapter(&menu_model); | 71 views::MenuModelAdapter menu_model_adapter(&menu_model); |
| 70 menu_runner_.reset(new views::MenuRunner(menu_model_adapter.CreateMenu())); | 72 menu_runner_.reset(new views::MenuRunner(menu_model_adapter.CreateMenu())); |
| 71 if (menu_runner_->RunMenuAt( | 73 if (menu_runner_->RunMenuAt( |
| 72 widget, NULL, gfx::Rect(location, gfx::Size()), | 74 widget, NULL, gfx::Rect(location, gfx::Size()), |
| 73 views::MenuItemView::TOPRIGHT, views::MenuRunner::HAS_MNEMONICS) == | 75 views::MenuItemView::TOPRIGHT, views::MenuRunner::HAS_MNEMONICS) == |
| 74 views::MenuRunner::MENU_DELETED) | 76 views::MenuRunner::MENU_DELETED) |
| 75 return; | 77 return; |
| 76 #endif // !defined(OS_MACOSX) | 78 #endif // !defined(OS_MACOSX) |
| 77 } | 79 } |
| 78 | 80 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 107 } | 109 } |
| 108 | 110 |
| 109 bool WorkspaceController::GetAcceleratorForCommandId( | 111 bool WorkspaceController::GetAcceleratorForCommandId( |
| 110 int command_id, | 112 int command_id, |
| 111 ui::Accelerator* accelerator) { | 113 ui::Accelerator* accelerator) { |
| 112 return false; | 114 return false; |
| 113 } | 115 } |
| 114 | 116 |
| 115 } // namespace internal | 117 } // namespace internal |
| 116 } // namespace ash | 118 } // namespace ash |
| OLD | NEW |