Chromium Code Reviews| Index: chrome/browser/ui/views/apps/native_app_window_views.cc |
| diff --git a/chrome/browser/ui/views/apps/native_app_window_views.cc b/chrome/browser/ui/views/apps/native_app_window_views.cc |
| index f2350ed8b56804082b51b2d52ebe650715ffa710..11007da59750c5c458f79a0543571e7938940c45 100644 |
| --- a/chrome/browser/ui/views/apps/native_app_window_views.cc |
| +++ b/chrome/browser/ui/views/apps/native_app_window_views.cc |
| @@ -455,33 +455,6 @@ bool NativeAppWindowViews::IsAlwaysOnTop() const { |
| } |
| } |
| -bool NativeAppWindowViews::IsFrameless() const { |
| - return frameless_; |
| -} |
| - |
| -gfx::Insets NativeAppWindowViews::GetFrameInsets() const { |
| - if (frameless_) |
| - return gfx::Insets(); |
| - |
| - // The pretend client_bounds passed in need to be large enough to ensure that |
| - // GetWindowBoundsForClientBounds() doesn't decide that it needs more than |
| - // the specified amount of space to fit the window controls in, and return a |
| - // number larger than the real frame insets. Most window controls are smaller |
| - // than 1000x1000px, so this should be big enough. |
| - gfx::Rect client_bounds = gfx::Rect(1000, 1000); |
| - gfx::Rect window_bounds = |
| - window_->non_client_view()->GetWindowBoundsForClientBounds( |
| - client_bounds); |
| - return window_bounds.InsetsFrom(client_bounds); |
| -} |
| - |
| -bool NativeAppWindowViews::IsVisible() const { |
| - return window_->IsVisible(); |
| -} |
| - |
| -void NativeAppWindowViews::HideWithApp() {} |
| -void NativeAppWindowViews::ShowWithApp() {} |
| - |
| void NativeAppWindowViews::SetAlwaysOnTop(bool always_on_top) { |
| window_->SetAlwaysOnTop(always_on_top); |
| shell_window_->OnNativeWindowChanged(); |
| @@ -642,6 +615,10 @@ const views::Widget* NativeAppWindowViews::GetWidget() const { |
| return window_; |
| } |
| +views::View* NativeAppWindowViews::GetContentsView() { |
| + return this; |
| +} |
| + |
| views::NonClientFrameView* NativeAppWindowViews::CreateNonClientFrameView( |
| views::Widget* widget) { |
| #if defined(USE_ASH) |
| @@ -717,6 +694,12 @@ void NativeAppWindowViews::RenderViewCreated( |
| } |
| } |
| +void NativeAppWindowViews::RenderViewHostChanged( |
| + content::RenderViewHost* old_host, |
| + content::RenderViewHost* new_host) { |
| + OnViewWasResized(); |
| +} |
| + |
| // views::View implementation. |
| void NativeAppWindowViews::Layout() { |
| @@ -797,10 +780,6 @@ bool NativeAppWindowViews::IsDetached() const { |
| #endif |
| } |
| -views::View* NativeAppWindowViews::GetContentsView() { |
| - return this; |
| -} |
| - |
| void NativeAppWindowViews::UpdateWindowIcon() { |
| window_->UpdateWindowIcon(); |
| } |
| @@ -809,10 +788,6 @@ void NativeAppWindowViews::UpdateWindowTitle() { |
| window_->UpdateWindowTitle(); |
| } |
| -void NativeAppWindowViews::UpdateInputRegion(scoped_ptr<SkRegion> region) { |
| - input_region_ = region.Pass(); |
| -} |
| - |
| void NativeAppWindowViews::UpdateDraggableRegions( |
| const std::vector<extensions::DraggableRegion>& regions) { |
| // Draggable region is not supported for non-frameless window. |
| @@ -827,14 +802,39 @@ SkRegion* NativeAppWindowViews::GetDraggableRegion() { |
| return draggable_region_.get(); |
| } |
| +void NativeAppWindowViews::UpdateInputRegion(scoped_ptr<SkRegion> region) { |
| + input_region_ = region.Pass(); |
| +} |
| + |
| void NativeAppWindowViews::HandleKeyboardEvent( |
| const content::NativeWebKeyboardEvent& event) { |
| unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
| GetFocusManager()); |
| } |
| -void NativeAppWindowViews::RenderViewHostChanged( |
| - content::RenderViewHost* old_host, |
| - content::RenderViewHost* new_host) { |
| - OnViewWasResized(); |
| +bool NativeAppWindowViews::IsFrameless() const { |
| + return frameless_; |
| } |
| + |
| +gfx::Insets NativeAppWindowViews::GetFrameInsets() const { |
| + if (frameless_) |
| + return gfx::Insets(); |
| + |
| + // The pretend client_bounds passed in need to be large enough to ensure that |
| + // GetWindowBoundsForClientBounds() doesn't decide that it needs more than |
| + // the specified amount of space to fit the window controls in, and return a |
| + // number larger than the real frame insets. Most window controls are smaller |
| + // than 1000x1000px, so this should be big enough. |
| + gfx::Rect client_bounds = gfx::Rect(1000, 1000); |
| + gfx::Rect window_bounds = |
| + window_->non_client_view()->GetWindowBoundsForClientBounds( |
| + client_bounds); |
| + return window_bounds.InsetsFrom(client_bounds); |
| +} |
| + |
| +bool NativeAppWindowViews::IsVisible() const { |
| + return window_->IsVisible(); |
| +} |
| + |
| +void NativeAppWindowViews::HideWithApp() {} |
|
stevenjb
2013/10/14 23:20:48
WS
|
| +void NativeAppWindowViews::ShowWithApp() {} |