| 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/shell/window_type_launcher.h" | 5 #include "ash/shell/window_type_launcher.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/screensaver/screensaver_view.h" | 8 #include "ash/screensaver/screensaver_view.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell/example_factory.h" | 10 #include "ash/shell/example_factory.h" |
| 11 #include "ash/shell/panel_window.h" | 11 #include "ash/shell/panel_window.h" |
| 12 #include "ash/shell/toplevel_window.h" | 12 #include "ash/shell/toplevel_window.h" |
| 13 #include "ash/shell_delegate.h" | 13 #include "ash/shell_delegate.h" |
| 14 #include "ash/shell_window_ids.h" | 14 #include "ash/shell_window_ids.h" |
| 15 #include "ash/system/status_area_widget.h" | 15 #include "ash/system/status_area_widget.h" |
| 16 #include "ash/system/web_notification/web_notification_tray.h" | 16 #include "ash/system/web_notification/web_notification_tray.h" |
| 17 #include "ash/wm/shadow_types.h" | |
| 18 #include "base/bind.h" | 17 #include "base/bind.h" |
| 19 #include "base/time.h" | 18 #include "base/time.h" |
| 20 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 21 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 22 #include "ui/aura/root_window.h" | 21 #include "ui/aura/root_window.h" |
| 23 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
| 24 #include "ui/compositor/layer.h" | 23 #include "ui/compositor/layer.h" |
| 25 #include "ui/gfx/canvas.h" | 24 #include "ui/gfx/canvas.h" |
| 26 #include "ui/views/controls/button/text_button.h" | 25 #include "ui/views/controls/button/text_button.h" |
| 27 #include "ui/views/controls/menu/menu_item_view.h" | 26 #include "ui/views/controls/menu/menu_item_view.h" |
| 28 #include "ui/views/controls/menu/menu_runner.h" | 27 #include "ui/views/controls/menu/menu_runner.h" |
| 28 #include "ui/views/corewm/shadow_types.h" |
| 29 #include "ui/views/examples/examples_window_with_content.h" | 29 #include "ui/views/examples/examples_window_with_content.h" |
| 30 #include "ui/views/layout/grid_layout.h" | 30 #include "ui/views/layout/grid_layout.h" |
| 31 #include "ui/views/widget/widget.h" | 31 #include "ui/views/widget/widget.h" |
| 32 | 32 |
| 33 using views::MenuItemView; | 33 using views::MenuItemView; |
| 34 using views::MenuRunner; | 34 using views::MenuRunner; |
| 35 | 35 |
| 36 namespace ash { | 36 namespace ash { |
| 37 namespace shell { | 37 namespace shell { |
| 38 | 38 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 layout->AddPaddingRow(0, 5); | 178 layout->AddPaddingRow(0, 5); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace | 181 } // namespace |
| 182 | 182 |
| 183 void InitWindowTypeLauncher() { | 183 void InitWindowTypeLauncher() { |
| 184 views::Widget* widget = | 184 views::Widget* widget = |
| 185 views::Widget::CreateWindowWithBounds(new WindowTypeLauncher, | 185 views::Widget::CreateWindowWithBounds(new WindowTypeLauncher, |
| 186 gfx::Rect(120, 150, 300, 410)); | 186 gfx::Rect(120, 150, 300, 410)); |
| 187 widget->GetNativeView()->SetName("WindowTypeLauncher"); | 187 widget->GetNativeView()->SetName("WindowTypeLauncher"); |
| 188 ash::internal::SetShadowType(widget->GetNativeView(), | 188 views::corewm::SetShadowType(widget->GetNativeView(), |
| 189 ash::internal::SHADOW_TYPE_RECTANGULAR); | 189 views::corewm::SHADOW_TYPE_RECTANGULAR); |
| 190 widget->Show(); | 190 widget->Show(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 WindowTypeLauncher::WindowTypeLauncher() | 193 WindowTypeLauncher::WindowTypeLauncher() |
| 194 : ALLOW_THIS_IN_INITIALIZER_LIST(create_button_( | 194 : ALLOW_THIS_IN_INITIALIZER_LIST(create_button_( |
| 195 new views::NativeTextButton(this, ASCIIToUTF16("Create Window")))), | 195 new views::NativeTextButton(this, ASCIIToUTF16("Create Window")))), |
| 196 ALLOW_THIS_IN_INITIALIZER_LIST(create_persistant_button_( | 196 ALLOW_THIS_IN_INITIALIZER_LIST(create_persistant_button_( |
| 197 new views::NativeTextButton( | 197 new views::NativeTextButton( |
| 198 this, ASCIIToUTF16("Create Persistant Window")))), | 198 this, ASCIIToUTF16("Create Persistant Window")))), |
| 199 ALLOW_THIS_IN_INITIALIZER_LIST(panel_button_( | 199 ALLOW_THIS_IN_INITIALIZER_LIST(panel_button_( |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 377 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
| 378 MenuItemView::TOPLEFT, | 378 MenuItemView::TOPLEFT, |
| 379 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 379 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
| 380 MenuRunner::MENU_DELETED) | 380 MenuRunner::MENU_DELETED) |
| 381 return; | 381 return; |
| 382 } | 382 } |
| 383 #endif // !defined(OS_MACOSX) | 383 #endif // !defined(OS_MACOSX) |
| 384 | 384 |
| 385 } // namespace shell | 385 } // namespace shell |
| 386 } // namespace ash | 386 } // namespace ash |
| OLD | NEW |