summaryrefslogtreecommitdiffstats
path: root/mandoline
diff options
context:
space:
mode:
authorsky <sky@chromium.org>2015-10-28 15:44:59 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-28 22:46:00 +0000
commit05b042644488cddc055805c2ee42f1656266aae2 (patch)
tree87f33b758a7ba47de74e3d7f643b6e8cb51e6296 /mandoline
parentdea7ae9bd84c6e66f74351f3af1368226ce2de17 (diff)
downloadchromium_src-05b042644488cddc055805c2ee42f1656266aae2.zip
chromium_src-05b042644488cddc055805c2ee42f1656266aae2.tar.gz
chromium_src-05b042644488cddc055805c2ee42f1656266aae2.tar.bz2
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}
Diffstat (limited to 'mandoline')
-rw-r--r--mandoline/ui/desktop_ui/browser_window.cc20
-rw-r--r--mandoline/ui/omnibox/omnibox_application.cc3
-rw-r--r--mandoline/ui/phone_ui/phone_browser_application_delegate.cc7
-rw-r--r--mandoline/ui/phone_ui/phone_browser_application_delegate.h4
4 files changed, 15 insertions, 19 deletions
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<mojo::Rect, gfx::Rect>::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<gfx::Rect>();
+ 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<gfx::Rect>();
+ 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;