From 05b042644488cddc055805c2ee42f1656266aae2 Mon Sep 17 00:00:00 2001 From: sky Date: Wed, 28 Oct 2015 15:44:59 -0700 Subject: Converts client lib to use gfx types BUG=none TEST=none R=ben@chromium.org Review URL: https://codereview.chromium.org/1418563013 Cr-Commit-Position: refs/heads/master@{#356676} --- mandoline/ui/desktop_ui/browser_window.cc | 20 +++++++++----------- mandoline/ui/omnibox/omnibox_application.cc | 3 +-- .../phone_ui/phone_browser_application_delegate.cc | 7 +++---- .../ui/phone_ui/phone_browser_application_delegate.h | 4 ++-- 4 files changed, 15 insertions(+), 19 deletions(-) (limited to 'mandoline') diff --git a/mandoline/ui/desktop_ui/browser_window.cc b/mandoline/ui/desktop_ui/browser_window.cc index 38e4edc..a6db187 100644 --- a/mandoline/ui/desktop_ui/browser_window.cc +++ b/mandoline/ui/desktop_ui/browser_window.cc @@ -352,18 +352,16 @@ void BrowserWindow::Layout(views::View* host) { toolbar_bounds.width(), 5); // The content view bounds are in physical pixels. - mojo::Rect content_bounds_mojo; - content_bounds_mojo.x = DIPSToPixels(progress_bar_bounds.x()); - content_bounds_mojo.y = DIPSToPixels(progress_bar_bounds.bottom()+ 10); - content_bounds_mojo.width = DIPSToPixels(progress_bar_bounds.width()); - content_bounds_mojo.height = - host->bounds().height() - content_bounds_mojo.y - DIPSToPixels(10); - content_->SetBounds(content_bounds_mojo); + gfx::Rect content_bounds(DIPSToPixels(progress_bar_bounds.x()), + DIPSToPixels(progress_bar_bounds.bottom() + 10), 0, + 0); + content_bounds.set_width(DIPSToPixels(progress_bar_bounds.width())); + content_bounds.set_height(host->bounds().height() - content_bounds.y() - + DIPSToPixels(10)); + content_->SetBounds(content_bounds); // The omnibox view bounds are in physical pixels. - omnibox_view_->SetBounds( - mojo::TypeConverter::Convert( - bounds_in_physical_pixels)); + omnibox_view_->SetBounds(bounds_in_physical_pixels); } //////////////////////////////////////////////////////////////////////////////// @@ -409,7 +407,7 @@ void BrowserWindow::Init(mus::Window* root) { params.native_widget = new views::NativeWidgetViewManager(widget, app_->shell(), root_); params.delegate = widget_delegate; - params.bounds = root_->bounds().To(); + params.bounds = root_->bounds(); widget->Init(params); widget->Show(); root_->SetFocus(); diff --git a/mandoline/ui/omnibox/omnibox_application.cc b/mandoline/ui/omnibox/omnibox_application.cc index a6082c7..c0cbd82 100644 --- a/mandoline/ui/omnibox/omnibox_application.cc +++ b/mandoline/ui/omnibox/omnibox_application.cc @@ -13,7 +13,6 @@ #include "mandoline/ui/desktop_ui/public/interfaces/view_embedder.mojom.h" #include "mojo/application/public/cpp/application_impl.h" #include "mojo/common/common_type_converters.h" -#include "mojo/converters/geometry/geometry_type_converters.h" #include "ui/views/background.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield_controller.h" @@ -139,7 +138,7 @@ void OmniboxImpl::OnEmbed(mus::Window* root) { params.native_widget = new views::NativeWidgetViewManager(widget, app_->shell(), root); params.delegate = widget_delegate; - params.bounds = root->bounds().To(); + params.bounds = root->bounds(); params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; widget->Init(params); widget->Show(); diff --git a/mandoline/ui/phone_ui/phone_browser_application_delegate.cc b/mandoline/ui/phone_ui/phone_browser_application_delegate.cc index b17e76a..d6f40fb 100644 --- a/mandoline/ui/phone_ui/phone_browser_application_delegate.cc +++ b/mandoline/ui/phone_ui/phone_browser_application_delegate.cc @@ -90,11 +90,10 @@ void PhoneBrowserApplicationDelegate::OnConnectionLost( void PhoneBrowserApplicationDelegate::OnWindowBoundsChanged( mus::Window* view, - const mojo::Rect& old_bounds, - const mojo::Rect& new_bounds) { + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) { CHECK_EQ(view, root_); - content_->SetBounds( - *mojo::Rect::From(gfx::Rect(0, 0, new_bounds.width, new_bounds.height))); + content_->SetBounds(gfx::Rect(new_bounds.size())); } //////////////////////////////////////////////////////////////////////////////// diff --git a/mandoline/ui/phone_ui/phone_browser_application_delegate.h b/mandoline/ui/phone_ui/phone_browser_application_delegate.h index a66f4cf..66a7a9e 100644 --- a/mandoline/ui/phone_ui/phone_browser_application_delegate.h +++ b/mandoline/ui/phone_ui/phone_browser_application_delegate.h @@ -50,8 +50,8 @@ class PhoneBrowserApplicationDelegate // Overridden from mus::WindowObserver: void OnWindowBoundsChanged(mus::Window* view, - const mojo::Rect& old_bounds, - const mojo::Rect& new_bounds) override; + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; // Overridden from web_view::mojom::WebViewClient: void TopLevelNavigateRequest(mojo::URLRequestPtr request) override; -- cgit v1.1