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

Side by Side Diff: services/native_viewport/platform_viewport_x11.cc

Issue 1311583003: Fix platform_viewport_x11 so that window is initially shown (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « mojo/services/native_viewport/public/interfaces/native_viewport.mojom ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "services/native_viewport/platform_viewport.h" 5 #include "services/native_viewport/platform_viewport.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "mojo/converters/geometry/geometry_type_converters.h" 9 #include "mojo/converters/geometry/geometry_type_converters.h"
10 #include "mojo/converters/input_events/input_events_type_converters.h" 10 #include "mojo/converters/input_events/input_events_type_converters.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 CHECK(!event_source_); 47 CHECK(!event_source_);
48 CHECK(!platform_window_); 48 CHECK(!platform_window_);
49 49
50 event_source_ = ui::PlatformEventSource::CreateDefault(); 50 event_source_ = ui::PlatformEventSource::CreateDefault();
51 51
52 metrics_ = mojo::ViewportMetrics::New(); 52 metrics_ = mojo::ViewportMetrics::New();
53 metrics_->size = mojo::Size::From(bounds.size()); 53 metrics_->size = mojo::Size::From(bounds.size());
54 54
55 platform_window_.reset(new ui::X11Window(this)); 55 platform_window_.reset(new ui::X11Window(this));
56 platform_window_->SetBounds(bounds); 56 platform_window_->SetBounds(bounds);
57
58 // X11 window isn't created until explicitly shown
59 Show();
57 } 60 }
58 61
59 void Show() override { platform_window_->Show(); } 62 void Show() override { platform_window_->Show(); }
60 63
61 void Hide() override { platform_window_->Hide(); } 64 void Hide() override { platform_window_->Hide(); }
62 65
63 void Close() override { platform_window_->Close(); } 66 void Close() override { platform_window_->Close(); }
64 67
65 gfx::Size GetSize() override { return metrics_->size.To<gfx::Size>(); } 68 gfx::Size GetSize() override { return metrics_->size.To<gfx::Size>(); }
66 69
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 }; 162 };
160 163
161 // static 164 // static
162 scoped_ptr<PlatformViewport> PlatformViewport::Create( 165 scoped_ptr<PlatformViewport> PlatformViewport::Create(
163 mojo::ApplicationImpl* application_, 166 mojo::ApplicationImpl* application_,
164 Delegate* delegate) { 167 Delegate* delegate) {
165 return make_scoped_ptr(new PlatformViewportX11(delegate)); 168 return make_scoped_ptr(new PlatformViewportX11(delegate));
166 } 169 }
167 170
168 } // namespace native_viewport 171 } // namespace native_viewport
OLDNEW
« no previous file with comments | « mojo/services/native_viewport/public/interfaces/native_viewport.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698