| 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/shell_window_ids.h" | 7 #include "ash/shell_window_ids.h" |
| 8 #include "ash/shell/example_factory.h" | 8 #include "ash/shell/example_factory.h" |
| 9 #include "ash/shell/panel_window.h" | 9 #include "ash/shell/panel_window.h" |
| 10 #include "ash/shell/toplevel_window.h" | 10 #include "ash/shell/toplevel_window.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 298 } |
| 299 | 299 |
| 300 bool WindowTypeLauncher::CanResize() const { | 300 bool WindowTypeLauncher::CanResize() const { |
| 301 return true; | 301 return true; |
| 302 } | 302 } |
| 303 | 303 |
| 304 string16 WindowTypeLauncher::GetWindowTitle() const { | 304 string16 WindowTypeLauncher::GetWindowTitle() const { |
| 305 return ASCIIToUTF16("Examples: Window Builder"); | 305 return ASCIIToUTF16("Examples: Window Builder"); |
| 306 } | 306 } |
| 307 | 307 |
| 308 bool WindowTypeLauncher::CanMaximize() const { |
| 309 return true; |
| 310 } |
| 311 |
| 308 void WindowTypeLauncher::ButtonPressed(views::Button* sender, | 312 void WindowTypeLauncher::ButtonPressed(views::Button* sender, |
| 309 const views::Event& event) { | 313 const views::Event& event) { |
| 310 if (sender == create_button_) { | 314 if (sender == create_button_) { |
| 311 ToplevelWindow::CreateParams params; | 315 ToplevelWindow::CreateParams params; |
| 312 params.can_resize = true; | 316 params.can_resize = true; |
| 313 params.can_maximize = true; | 317 params.can_maximize = true; |
| 314 ToplevelWindow::CreateToplevelWindow(params); | 318 ToplevelWindow::CreateToplevelWindow(params); |
| 315 } else if (sender == panel_button_) { | 319 } else if (sender == panel_button_) { |
| 316 PanelWindow::CreatePanelWindow(gfx::Rect()); | 320 PanelWindow::CreatePanelWindow(gfx::Rect()); |
| 317 } else if (sender == create_nonresizable_button_) { | 321 } else if (sender == create_nonresizable_button_) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 menu_runner_.reset(new MenuRunner(root)); | 373 menu_runner_.reset(new MenuRunner(root)); |
| 370 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 374 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
| 371 MenuItemView::TOPLEFT, | 375 MenuItemView::TOPLEFT, |
| 372 MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) | 376 MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) |
| 373 return; | 377 return; |
| 374 } | 378 } |
| 375 #endif // !defined(OS_MACOSX) | 379 #endif // !defined(OS_MACOSX) |
| 376 | 380 |
| 377 } // namespace shell | 381 } // namespace shell |
| 378 } // namespace ash | 382 } // namespace ash |
| OLD | NEW |