| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/constrained_window_views.h" | 5 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "ui/views/window/client_view.h" | 39 #include "ui/views/window/client_view.h" |
| 40 #include "ui/views/window/frame_background.h" | 40 #include "ui/views/window/frame_background.h" |
| 41 #include "ui/views/window/non_client_view.h" | 41 #include "ui/views/window/non_client_view.h" |
| 42 #include "ui/views/window/window_resources.h" | 42 #include "ui/views/window/window_resources.h" |
| 43 #include "ui/views/window/window_shape.h" | 43 #include "ui/views/window/window_shape.h" |
| 44 | 44 |
| 45 #if defined(OS_WIN) && !defined(USE_AURA) | 45 #if defined(OS_WIN) && !defined(USE_AURA) |
| 46 #include "ui/views/widget/native_widget_win.h" | 46 #include "ui/views/widget/native_widget_win.h" |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 #if defined(USE_AURA) |
| 50 #include "ash/shell.h" |
| 51 #endif |
| 52 |
| 49 using base::TimeDelta; | 53 using base::TimeDelta; |
| 50 | 54 |
| 51 namespace views { | 55 namespace views { |
| 52 class ClientView; | 56 class ClientView; |
| 53 } | 57 } |
| 54 | 58 |
| 55 // An enumeration of bitmap resources used by this window. | 59 // An enumeration of bitmap resources used by this window. |
| 56 enum { | 60 enum { |
| 57 FRAME_PART_BITMAP_FIRST = 0, // Must be first. | 61 FRAME_PART_BITMAP_FIRST = 0, // Must be first. |
| 58 | 62 |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 } | 599 } |
| 596 | 600 |
| 597 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() { | 601 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() { |
| 598 return Widget::GetNativeWindow(); | 602 return Widget::GetNativeWindow(); |
| 599 } | 603 } |
| 600 | 604 |
| 601 //////////////////////////////////////////////////////////////////////////////// | 605 //////////////////////////////////////////////////////////////////////////////// |
| 602 // ConstrainedWindowViews, views::Widget overrides: | 606 // ConstrainedWindowViews, views::Widget overrides: |
| 603 | 607 |
| 604 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { | 608 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { |
| 609 #if defined(USE_AURA) |
| 610 return ash::Shell::GetInstance()->CreateDefaultNonClientFrameView(this); |
| 611 #else |
| 605 return new ConstrainedWindowFrameView(this); | 612 return new ConstrainedWindowFrameView(this); |
| 613 #endif |
| 606 } | 614 } |
| 607 | 615 |
| 608 //////////////////////////////////////////////////////////////////////////////// | 616 //////////////////////////////////////////////////////////////////////////////// |
| 609 // ConstrainedWindowViews, NativeConstrainedWindowDelegate implementation: | 617 // ConstrainedWindowViews, NativeConstrainedWindowDelegate implementation: |
| 610 | 618 |
| 611 void ConstrainedWindowViews::OnNativeConstrainedWindowDestroyed() { | 619 void ConstrainedWindowViews::OnNativeConstrainedWindowDestroyed() { |
| 612 wrapper_->constrained_window_tab_helper()->WillClose(this); | 620 wrapper_->constrained_window_tab_helper()->WillClose(this); |
| 613 } | 621 } |
| 614 | 622 |
| 615 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { | 623 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { |
| 616 Activate(); | 624 Activate(); |
| 617 } | 625 } |
| 618 | 626 |
| 619 views::internal::NativeWidgetDelegate* | 627 views::internal::NativeWidgetDelegate* |
| 620 ConstrainedWindowViews::AsNativeWidgetDelegate() { | 628 ConstrainedWindowViews::AsNativeWidgetDelegate() { |
| 621 return this; | 629 return this; |
| 622 } | 630 } |
| OLD | NEW |