| 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 "mash/example/window_type_launcher/window_type_launcher.h" | 5 #include "mash/example/window_type_launcher/window_type_launcher.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "mash/shell/public/interfaces/shell.mojom.h" | 9 #include "mash/shell/public/interfaces/shell.mojom.h" |
| 10 #include "mojo/converters/geometry/geometry_type_converters.h" | 10 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 11 #include "mojo/shell/public/cpp/application_connection.h" | 11 #include "mojo/shell/public/cpp/connection.h" |
| 12 #include "mojo/shell/public/cpp/shell.h" | 12 #include "mojo/shell/public/cpp/shell.h" |
| 13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 14 #include "ui/aura/window_event_dispatcher.h" | 14 #include "ui/aura/window_event_dispatcher.h" |
| 15 #include "ui/compositor/layer.h" | 15 #include "ui/compositor/layer.h" |
| 16 #include "ui/gfx/canvas.h" | 16 #include "ui/gfx/canvas.h" |
| 17 #include "ui/views/context_menu_controller.h" | 17 #include "ui/views/context_menu_controller.h" |
| 18 #include "ui/views/controls/button/button.h" | 18 #include "ui/views/controls/button/button.h" |
| 19 #include "ui/views/controls/button/label_button.h" | 19 #include "ui/views/controls/button/label_button.h" |
| 20 #include "ui/views/controls/menu/menu_delegate.h" | 20 #include "ui/views/controls/menu/menu_delegate.h" |
| 21 #include "ui/views/controls/menu/menu_item_view.h" | 21 #include "ui/views/controls/menu/menu_item_view.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 scoped_ptr<views::MenuRunner> menu_runner_; | 348 scoped_ptr<views::MenuRunner> menu_runner_; |
| 349 | 349 |
| 350 DISALLOW_COPY_AND_ASSIGN(WindowTypeLauncherView); | 350 DISALLOW_COPY_AND_ASSIGN(WindowTypeLauncherView); |
| 351 }; | 351 }; |
| 352 | 352 |
| 353 } // namespace | 353 } // namespace |
| 354 | 354 |
| 355 WindowTypeLauncher::WindowTypeLauncher() {} | 355 WindowTypeLauncher::WindowTypeLauncher() {} |
| 356 WindowTypeLauncher::~WindowTypeLauncher() {} | 356 WindowTypeLauncher::~WindowTypeLauncher() {} |
| 357 | 357 |
| 358 bool WindowTypeLauncher::AcceptConnection( | |
| 359 mojo::ApplicationConnection* connection) { | |
| 360 return false; | |
| 361 } | |
| 362 | |
| 363 void WindowTypeLauncher::Initialize(mojo::Shell* shell, const std::string& url, | 358 void WindowTypeLauncher::Initialize(mojo::Shell* shell, const std::string& url, |
| 364 uint32_t id) { | 359 uint32_t id) { |
| 365 aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak")); | 360 aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak")); |
| 366 | 361 |
| 367 views::WindowManagerConnection::Create(shell); | 362 views::WindowManagerConnection::Create(shell); |
| 368 | 363 |
| 369 views::Widget* widget = new views::Widget; | 364 views::Widget* widget = new views::Widget; |
| 370 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 365 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| 371 params.delegate = new WindowTypeLauncherView(shell); | 366 params.delegate = new WindowTypeLauncherView(shell); |
| 372 widget->Init(params); | 367 widget->Init(params); |
| 373 widget->Show(); | 368 widget->Show(); |
| 374 } | 369 } |
| OLD | NEW |