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

Unified Diff: mojo/examples/media_viewer/media_viewer.cc

Issue 658923003: Remove dependency on ui from view_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: mojo/examples/media_viewer/media_viewer.cc
diff --git a/mojo/examples/media_viewer/media_viewer.cc b/mojo/examples/media_viewer/media_viewer.cc
index 4d23a8e18859fffc8059758f4321630dadcd4d1b..c5dbd4d01341e3e615e9b2d0f5d3229b2cfa3da0 100644
--- a/mojo/examples/media_viewer/media_viewer.cc
+++ b/mojo/examples/media_viewer/media_viewer.cc
@@ -164,7 +164,7 @@ class ControlPanel : public views::ButtonListener {
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
params.native_widget = new NativeWidgetViewManager(widget, shell, view);
params.delegate = widget_delegate;
- params.bounds = gfx::Rect(view->bounds().width(), view->bounds().height());
+ params.bounds = gfx::Rect(view->bounds().width, view->bounds().height);
params.opacity = views::Widget::InitParams::OPAQUE_WINDOW;
widget->Init(params);
widget->Show();
@@ -232,10 +232,14 @@ class MediaViewer
void LayoutViews() {
View* root = content_view_->parent();
- gfx::Rect control_bounds(root->bounds().width(), 28);
+ Rect control_bounds;
+ control_bounds.width = root->bounds().width;
+ control_bounds.height = 28;
control_view_->SetBounds(control_bounds);
- gfx::Rect content_bounds(0, control_bounds.height(), root->bounds().width(),
- root->bounds().height() - control_bounds.height());
+ Rect content_bounds;
+ content_bounds.y = control_bounds.height;
+ content_bounds.width = root->bounds().width;
+ content_bounds.height = root->bounds().height - control_bounds.height;
content_view_->SetBounds(content_bounds);
}
@@ -287,8 +291,8 @@ class MediaViewer
// ViewObserver:
virtual void OnViewBoundsChanged(View* view,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) override {
+ const Rect& old_bounds,
+ const Rect& new_bounds) override {
LayoutViews();
}
virtual void OnViewDestroyed(View* view) override {

Powered by Google App Engine
This is Rietveld 408576698