forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert of view_manager: Add a stub impl for PlatformWindow, and remov…
…e PlatformViewportHeadless. (patchset chromium#2 id:20001 of https://codereview.chromium.org/1214373004/) Reason for revert: Broke the mac/gn bot: http://build.chromium.org/p/chromium.mac/builders/Mac%20GN/builds/11926 ERROR at //ui/platform_window/BUILD.gn:35:3: Undefined variable for +=. deps += [ "//ui/platform_window/stub" ] ^--- I don't have something with this name in scope now. Original issue's description: > view_manager: Add a stub impl for PlatformWindow, and remove PlatformViewportHeadless. > > After this change, only a single implementation of PlatformViewport remains. A follow-up CL > will remove PlatformViewport entirely, and directly use PlatformWindow from DisplayManager > instead. > > BUG=487881 > > Committed: https://crrev.com/c8d744ce9c9f96a63be9fcf2b67ff7202986ff3a > Cr-Commit-Position: refs/heads/master@{#337068} TBR=sky@chromium.org,sadrul@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=487881 Review URL: https://codereview.chromium.org/1216943006 Cr-Commit-Position: refs/heads/master@{#337153}
- Loading branch information
Showing
10 changed files
with
122 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
components/view_manager/native_viewport/platform_viewport_headless.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "components/view_manager/native_viewport/platform_viewport_headless.h" | ||
|
||
#include "mojo/converters/geometry/geometry_type_converters.h" | ||
|
||
namespace native_viewport { | ||
|
||
PlatformViewportHeadless::PlatformViewportHeadless(Delegate* delegate) | ||
: delegate_(delegate) { | ||
} | ||
|
||
PlatformViewportHeadless::~PlatformViewportHeadless() { | ||
} | ||
|
||
void PlatformViewportHeadless::Init(const gfx::Rect& bounds) { | ||
metrics_ = mojo::ViewportMetrics::New(); | ||
metrics_->device_pixel_ratio = 1.f; | ||
metrics_->size_in_pixels = mojo::Size::From(bounds.size()); | ||
|
||
// The delegate assumes an initial metrics of 0. | ||
delegate_->OnMetricsChanged(bounds.size(), 1.f /* device_scale_factor */); | ||
} | ||
|
||
void PlatformViewportHeadless::Show() { | ||
} | ||
|
||
void PlatformViewportHeadless::Hide() { | ||
} | ||
|
||
void PlatformViewportHeadless::Close() { | ||
delegate_->OnDestroyed(); | ||
} | ||
|
||
gfx::Size PlatformViewportHeadless::GetSize() { | ||
return metrics_->size_in_pixels.To<gfx::Size>(); | ||
} | ||
|
||
void PlatformViewportHeadless::SetBounds(const gfx::Rect& bounds) { | ||
delegate_->OnMetricsChanged(bounds.size(), 1.f /* device_scale_factor */); | ||
} | ||
|
||
// static | ||
scoped_ptr<PlatformViewport> PlatformViewportHeadless::Create( | ||
Delegate* delegate) { | ||
return scoped_ptr<PlatformViewport>( | ||
new PlatformViewportHeadless(delegate)).Pass(); | ||
} | ||
|
||
} // namespace native_viewport |
40 changes: 40 additions & 0 deletions
40
components/view_manager/native_viewport/platform_viewport_headless.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef COMPONENTS_VIEW_MANAGER_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_HEADLESS_H_ | ||
#define COMPONENTS_VIEW_MANAGER_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_HEADLESS_H_ | ||
|
||
#include "base/macros.h" | ||
#include "components/view_manager/native_viewport/platform_viewport.h" | ||
#include "components/view_manager/public/interfaces/view_manager.mojom.h" | ||
#include "ui/gfx/geometry/rect.h" | ||
|
||
namespace native_viewport { | ||
|
||
class PlatformViewportHeadless : public PlatformViewport { | ||
public: | ||
~PlatformViewportHeadless() override; | ||
|
||
static scoped_ptr<PlatformViewport> Create(Delegate* delegate); | ||
|
||
private: | ||
explicit PlatformViewportHeadless(Delegate* delegate); | ||
|
||
// Overridden from PlatformViewport: | ||
void Init(const gfx::Rect& bounds) override; | ||
void Show() override; | ||
void Hide() override; | ||
void Close() override; | ||
gfx::Size GetSize() override; | ||
void SetBounds(const gfx::Rect& bounds) override; | ||
|
||
Delegate* delegate_; | ||
mojo::ViewportMetricsPtr metrics_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(PlatformViewportHeadless); | ||
}; | ||
|
||
} // namespace native_viewport | ||
|
||
#endif // COMPONENTS_VIEW_MANAGER_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_HEADLESS_H_ |
14 changes: 14 additions & 0 deletions
14
components/view_manager/native_viewport/platform_viewport_stub.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "components/view_manager/native_viewport/platform_viewport_headless.h" | ||
|
||
namespace mojo { | ||
|
||
// static | ||
scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate) { | ||
return PlatformViewportHeadless::Create(delegate); | ||
} | ||
|
||
} // namespace mojo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,5 +32,4 @@ group("platform_impls") { | |
"//ui/platform_window/win", | ||
] | ||
} | ||
deps += [ "//ui/platform_window/stub" ] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.