| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" | 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "apps/ui/views/app_window_frame_view.h" | 10 #include "apps/ui/views/app_window_frame_view.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 else if (preferred_size_.width() < kMinPanelWidth) | 209 else if (preferred_size_.width() < kMinPanelWidth) |
| 210 preferred_size_.set_width(kMinPanelWidth); | 210 preferred_size_.set_width(kMinPanelWidth); |
| 211 | 211 |
| 212 if (preferred_size_.height() == 0) | 212 if (preferred_size_.height() == 0) |
| 213 preferred_size_.set_height(kDefaultPanelHeight); | 213 preferred_size_.set_height(kDefaultPanelHeight); |
| 214 else if (preferred_size_.height() < kMinPanelHeight) | 214 else if (preferred_size_.height() < kMinPanelHeight) |
| 215 preferred_size_.set_height(kMinPanelHeight); | 215 preferred_size_.set_height(kMinPanelHeight); |
| 216 | 216 |
| 217 // When a panel is not docked it will be placed at a default origin in the | 217 // When a panel is not docked it will be placed at a default origin in the |
| 218 // currently active target root window. | 218 // currently active target root window. |
| 219 // TODO(afakhry): Remove in M58. |
| 219 bool use_default_bounds = create_params.state != ui::SHOW_STATE_DOCKED; | 220 bool use_default_bounds = create_params.state != ui::SHOW_STATE_DOCKED; |
| 220 // Sanitize initial origin reseting it in case it was not specified. | 221 // Sanitize initial origin reseting it in case it was not specified. |
| 221 using BoundsSpecification = AppWindow::BoundsSpecification; | 222 using BoundsSpecification = AppWindow::BoundsSpecification; |
| 222 bool position_specified = | 223 bool position_specified = |
| 223 initial_window_bounds.x() != BoundsSpecification::kUnspecifiedPosition && | 224 initial_window_bounds.x() != BoundsSpecification::kUnspecifiedPosition && |
| 224 initial_window_bounds.y() != BoundsSpecification::kUnspecifiedPosition; | 225 initial_window_bounds.y() != BoundsSpecification::kUnspecifiedPosition; |
| 225 params.bounds = (use_default_bounds || !position_specified) ? | 226 params.bounds = (use_default_bounds || !position_specified) ? |
| 226 gfx::Rect(preferred_size_) : | 227 gfx::Rect(preferred_size_) : |
| 227 gfx::Rect(initial_window_bounds.origin(), preferred_size_); | 228 gfx::Rect(initial_window_bounds.origin(), preferred_size_); |
| 228 OnBeforePanelWidgetInit(use_default_bounds, ¶ms, widget()); | 229 OnBeforePanelWidgetInit(use_default_bounds, ¶ms, widget()); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 InitializePanelWindow(create_params); | 375 InitializePanelWindow(create_params); |
| 375 } else { | 376 } else { |
| 376 InitializeDefaultWindow(create_params); | 377 InitializeDefaultWindow(create_params); |
| 377 } | 378 } |
| 378 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( | 379 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( |
| 379 Profile::FromBrowserContext(app_window->browser_context()), | 380 Profile::FromBrowserContext(app_window->browser_context()), |
| 380 widget()->GetFocusManager(), | 381 widget()->GetFocusManager(), |
| 381 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, | 382 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, |
| 382 NULL)); | 383 NULL)); |
| 383 } | 384 } |
| OLD | NEW |