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

Side by Side Diff: mash/system_ui/system_ui.cc

Issue 1527183003: Change mojo enums to be scoped enums in the generated C++ bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-equals
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/system_ui/system_ui.h" 5 #include "mash/system_ui/system_ui.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "components/mus/public/cpp/property_type_converters.h" 10 #include "components/mus/public/cpp/property_type_converters.h"
(...skipping 15 matching lines...) Expand all
26 public: 26 public:
27 static void Create(mojo::Shell* shell) { 27 static void Create(mojo::Shell* shell) {
28 views::Widget* widget = new views::Widget; 28 views::Widget* widget = new views::Widget;
29 views::Widget::InitParams params( 29 views::Widget::InitParams params(
30 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 30 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
31 params.delegate = new DesktopBackground; 31 params.delegate = new DesktopBackground;
32 32
33 std::map<std::string, std::vector<uint8_t>> properties; 33 std::map<std::string, std::vector<uint8_t>> properties;
34 properties[mash::wm::mojom::kWindowContainer_Property] = 34 properties[mash::wm::mojom::kWindowContainer_Property] =
35 mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert( 35 mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert(
36 mash::wm::mojom::CONTAINER_USER_BACKGROUND); 36 static_cast<int32_t>(mash::wm::mojom::Container::USER_BACKGROUND));
37 mus::Window* window = 37 mus::Window* window =
38 views::WindowManagerConnection::Get()->NewWindow(properties); 38 views::WindowManagerConnection::Get()->NewWindow(properties);
39 params.native_widget = new views::NativeWidgetMus( 39 params.native_widget = new views::NativeWidgetMus(
40 widget, shell, window, mus::mojom::SURFACE_TYPE_DEFAULT); 40 widget, shell, window, mus::mojom::SurfaceType::DEFAULT);
41 widget->Init(params); 41 widget->Init(params);
42 widget->Show(); 42 widget->Show();
43 } 43 }
44 44
45 private: 45 private:
46 DesktopBackground() {} 46 DesktopBackground() {}
47 ~DesktopBackground() override {} 47 ~DesktopBackground() override {}
48 48
49 // Overridden from views::View: 49 // Overridden from views::View:
50 void OnPaint(gfx::Canvas* canvas) override { 50 void OnPaint(gfx::Canvas* canvas) override {
(...skipping 10 matching lines...) Expand all
61 public: 61 public:
62 static void Create(mojo::Shell* shell) { 62 static void Create(mojo::Shell* shell) {
63 views::Widget* widget = new views::Widget; 63 views::Widget* widget = new views::Widget;
64 views::Widget::InitParams params( 64 views::Widget::InitParams params(
65 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 65 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
66 params.delegate = new Shelf; 66 params.delegate = new Shelf;
67 67
68 std::map<std::string, std::vector<uint8_t>> properties; 68 std::map<std::string, std::vector<uint8_t>> properties;
69 properties[mash::wm::mojom::kWindowContainer_Property] = 69 properties[mash::wm::mojom::kWindowContainer_Property] =
70 mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert( 70 mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert(
71 mash::wm::mojom::CONTAINER_USER_SHELF); 71 static_cast<int32_t>(mash::wm::mojom::Container::USER_SHELF));
72 mus::Window* window = 72 mus::Window* window =
73 views::WindowManagerConnection::Get()->NewWindow(properties); 73 views::WindowManagerConnection::Get()->NewWindow(properties);
74 params.native_widget = new views::NativeWidgetMus( 74 params.native_widget = new views::NativeWidgetMus(
75 widget, shell, window, mus::mojom::SURFACE_TYPE_DEFAULT); 75 widget, shell, window, mus::mojom::SurfaceType::DEFAULT);
76 widget->Init(params); 76 widget->Init(params);
77 widget->Show(); 77 widget->Show();
78 } 78 }
79 79
80 private: 80 private:
81 Shelf() {} 81 Shelf() {}
82 ~Shelf() override {} 82 ~Shelf() override {}
83 83
84 // Overridden from views::View: 84 // Overridden from views::View:
85 void OnPaint(gfx::Canvas* canvas) override { 85 void OnPaint(gfx::Canvas* canvas) override {
(...skipping 24 matching lines...) Expand all
110 Shelf::Create(app->shell()); 110 Shelf::Create(app->shell());
111 } 111 }
112 112
113 bool SystemUI::ConfigureIncomingConnection( 113 bool SystemUI::ConfigureIncomingConnection(
114 mojo::ApplicationConnection* connection) { 114 mojo::ApplicationConnection* connection) {
115 return true; 115 return true;
116 } 116 }
117 117
118 } // namespace system_ui 118 } // namespace system_ui
119 } // namespace mash 119 } // namespace mash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698