Code style fixes
This commit is contained in:
parent
276e12ce71
commit
7e0593950c
10 changed files with 56 additions and 57 deletions
|
@ -171,33 +171,36 @@ void AutofillPopup::UpdatePopupBounds(int height_compensation) {
|
|||
bool is_rtl = false;
|
||||
|
||||
gfx::Point origin(element_bounds_.origin().x(),
|
||||
element_bounds_.origin().y() - height_compensation);
|
||||
element_bounds_.origin().y() - height_compensation);
|
||||
gfx::Rect bounds(origin, element_bounds_.size());
|
||||
|
||||
gfx::Point top_left_corner_of_popup = origin +
|
||||
gfx::Vector2d(bounds.width() - desired_width, -desired_height);
|
||||
gfx::Point top_left_corner_of_popup =
|
||||
origin + gfx::Vector2d(bounds.width() - desired_width, -desired_height);
|
||||
|
||||
// This is the bottom right point of the popup if the popup is below the
|
||||
// element and grows to the right (since the is the lowest and furthest right
|
||||
// the popup could go).
|
||||
gfx::Point bottom_right_corner_of_popup = origin +
|
||||
gfx::Vector2d(desired_width, bounds.height() + desired_height);
|
||||
gfx::Point bottom_right_corner_of_popup =
|
||||
origin + gfx::Vector2d(desired_width, bounds.height() + desired_height);
|
||||
|
||||
display::Display top_left_display =
|
||||
GetDisplayNearestPoint(top_left_corner_of_popup, container_view_);
|
||||
GetDisplayNearestPoint(top_left_corner_of_popup, container_view_);
|
||||
display::Display bottom_right_display =
|
||||
GetDisplayNearestPoint(bottom_right_corner_of_popup, container_view_);
|
||||
GetDisplayNearestPoint(bottom_right_corner_of_popup, container_view_);
|
||||
|
||||
std::pair<int, int> popup_x_and_width =
|
||||
CalculatePopupXAndWidth(top_left_display, bottom_right_display,
|
||||
desired_width, bounds, is_rtl);
|
||||
std::pair<int, int> popup_y_and_height = CalculatePopupYAndHeight(
|
||||
top_left_display, bottom_right_display, desired_height, bounds);
|
||||
CalculatePopupXAndWidth(top_left_display, bottom_right_display,
|
||||
desired_width, bounds, is_rtl);
|
||||
std::pair<int, int> popup_y_and_height =
|
||||
CalculatePopupYAndHeight(top_left_display, bottom_right_display,
|
||||
desired_height, bounds);
|
||||
|
||||
popup_bounds_ = gfx::Rect(popup_x_and_width.first, popup_y_and_height.first,
|
||||
popup_x_and_width.second, popup_y_and_height.second);
|
||||
popup_bounds_in_view_ = gfx::Rect(popup_bounds_in_view_.origin(),
|
||||
gfx::Size(popup_x_and_width.second, popup_y_and_height.second));
|
||||
popup_bounds_ = gfx::Rect(
|
||||
popup_x_and_width.first, popup_y_and_height.first,
|
||||
popup_x_and_width.second, popup_y_and_height.second);
|
||||
popup_bounds_in_view_ = gfx::Rect(
|
||||
popup_bounds_in_view_.origin(),
|
||||
gfx::Size(popup_x_and_width.second, popup_y_and_height.second));
|
||||
if (view_)
|
||||
view_->DoUpdateBoundsAndRedrawPopup();
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ int ShowMessageBox(NativeWindow* parent_window,
|
|||
// Use runModal for synchronous alert without parent, since we don't have a
|
||||
// window to wait for.
|
||||
if (!parent_window || !parent_window->GetNativeWindow() ||
|
||||
parent_window->IsOffScreenDummy())
|
||||
parent_window->is_offscreen_dummy())
|
||||
return [[alert autorelease] runModal];
|
||||
|
||||
int ret_code = -1;
|
||||
|
@ -186,7 +186,7 @@ void ShowMessageBox(NativeWindow* parent_window,
|
|||
// Use runModal for synchronous alert without parent, since we don't have a
|
||||
// window to wait for.
|
||||
if (!parent_window || !parent_window->GetNativeWindow() ||
|
||||
parent_window->IsOffScreenDummy()) {
|
||||
parent_window->is_offscreen_dummy()) {
|
||||
int ret = [[alert autorelease] runModal];
|
||||
callback.Run(ret, false);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue