| OLD | NEW |
| 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 "mojo/services/native_viewport/native_viewport.h" | 5 #include "mojo/services/native_viewport/native_viewport.h" |
| 6 | 6 |
| 7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
| 8 #include "ui/gfx/win/window_impl.h" | 8 #include "ui/gfx/win/window_impl.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 // Overridden from NativeViewport: | 25 // Overridden from NativeViewport: |
| 26 virtual gfx::Size GetSize() OVERRIDE { | 26 virtual gfx::Size GetSize() OVERRIDE { |
| 27 RECT cr; | 27 RECT cr; |
| 28 GetClientRect(hwnd(), &cr); | 28 GetClientRect(hwnd(), &cr); |
| 29 return gfx::Size(cr.right - cr.left, cr.bottom - cr.top); | 29 return gfx::Size(cr.right - cr.left, cr.bottom - cr.top); |
| 30 } | 30 } |
| 31 | 31 |
| 32 virtual void Init() OVERRIDE { | 32 virtual void Init() OVERRIDE { |
| 33 gfx::WindowImpl::Init(NULL, gfx::Rect(10, 10, 500, 500)); | 33 gfx::WindowImpl::Init(NULL, gfx::Rect(10, 10, 800, 600)); |
| 34 ShowWindow(hwnd(), SW_SHOWNORMAL); | 34 ShowWindow(hwnd(), SW_SHOWNORMAL); |
| 35 SetWindowText(hwnd(), L"native_viewport::NativeViewportWin!"); | 35 SetWindowText(hwnd(), L"native_viewport::NativeViewportWin!"); |
| 36 } | 36 } |
| 37 | 37 |
| 38 virtual void Close() OVERRIDE { | 38 virtual void Close() OVERRIDE { |
| 39 DestroyWindow(hwnd()); | 39 DestroyWindow(hwnd()); |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual void SetCapture() OVERRIDE { | 42 virtual void SetCapture() OVERRIDE { |
| 43 DCHECK(::GetCapture() != hwnd()); | 43 DCHECK(::GetCapture() != hwnd()); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 // static | 98 // static |
| 99 scoped_ptr<NativeViewport> NativeViewport::Create( | 99 scoped_ptr<NativeViewport> NativeViewport::Create( |
| 100 shell::Context* context, | 100 shell::Context* context, |
| 101 NativeViewportDelegate* delegate) { | 101 NativeViewportDelegate* delegate) { |
| 102 return scoped_ptr<NativeViewport>(new NativeViewportWin(delegate)).Pass(); | 102 return scoped_ptr<NativeViewport>(new NativeViewportWin(delegate)).Pass(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace services | 105 } // namespace services |
| 106 } // namespace mojo | 106 } // namespace mojo |
| OLD | NEW |