| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "ui/gfx/rect.h" | 34 #include "ui/gfx/rect.h" |
| 35 #include "ui/gfx/screen.h" | 35 #include "ui/gfx/screen.h" |
| 36 #include "ui/views/color_constants.h" | 36 #include "ui/views/color_constants.h" |
| 37 #include "ui/views/controls/button/image_button.h" | 37 #include "ui/views/controls/button/image_button.h" |
| 38 #include "ui/views/focus/focus_manager.h" | 38 #include "ui/views/focus/focus_manager.h" |
| 39 #include "ui/views/views_delegate.h" | 39 #include "ui/views/views_delegate.h" |
| 40 #include "ui/views/widget/widget.h" | 40 #include "ui/views/widget/widget.h" |
| 41 #include "ui/views/window/client_view.h" | 41 #include "ui/views/window/client_view.h" |
| 42 #include "ui/views/window/dialog_client_view.h" | 42 #include "ui/views/window/dialog_client_view.h" |
| 43 #include "ui/views/window/dialog_delegate.h" | 43 #include "ui/views/window/dialog_delegate.h" |
| 44 #include "ui/views/window/dialog_frame_view.h" | |
| 45 #include "ui/views/window/frame_background.h" | 44 #include "ui/views/window/frame_background.h" |
| 46 #include "ui/views/window/non_client_view.h" | 45 #include "ui/views/window/non_client_view.h" |
| 47 #include "ui/views/window/window_resources.h" | 46 #include "ui/views/window/window_resources.h" |
| 48 #include "ui/views/window/window_shape.h" | 47 #include "ui/views/window/window_shape.h" |
| 49 | 48 |
| 50 #if defined(OS_WIN) && !defined(USE_AURA) | 49 #if defined(OS_WIN) && !defined(USE_AURA) |
| 51 #include "ui/base/win/shell.h" | 50 #include "ui/base/win/shell.h" |
| 52 #include "ui/views/widget/native_widget_win.h" | 51 #include "ui/views/widget/native_widget_win.h" |
| 53 #endif | 52 #endif |
| 54 | 53 |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 | 627 |
| 629 void ConstrainedWindowViews::PulseWebContentsModalDialog() { | 628 void ConstrainedWindowViews::PulseWebContentsModalDialog() { |
| 630 } | 629 } |
| 631 | 630 |
| 632 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() { | 631 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() { |
| 633 return Widget::GetNativeWindow(); | 632 return Widget::GetNativeWindow(); |
| 634 } | 633 } |
| 635 | 634 |
| 636 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { | 635 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { |
| 637 if (views::DialogDelegate::UseNewStyle()) | 636 if (views::DialogDelegate::UseNewStyle()) |
| 638 return new views::DialogFrameView(widget_delegate()->GetWindowTitle()); | 637 return views::DialogDelegate::CreateNewStyleFrameView(this); |
| 639 #if defined(USE_ASH) | 638 #if defined(USE_ASH) |
| 640 ConstrainedWindowFrameViewAsh* frame = new ConstrainedWindowFrameViewAsh; | 639 ConstrainedWindowFrameViewAsh* frame = new ConstrainedWindowFrameViewAsh; |
| 641 frame->Init(this); | 640 frame->Init(this); |
| 642 return frame; | 641 return frame; |
| 643 #endif | 642 #endif |
| 644 return new ConstrainedWindowFrameView(this); | 643 return new ConstrainedWindowFrameView(this); |
| 645 } | 644 } |
| 646 | 645 |
| 647 void ConstrainedWindowViews::OnNativeConstrainedWindowDestroyed() { | 646 void ConstrainedWindowViews::OnNativeConstrainedWindowDestroyed() { |
| 648 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 647 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 649 WebContentsModalDialogManager::FromWebContents(web_contents_); | 648 WebContentsModalDialogManager::FromWebContents(web_contents_); |
| 650 web_contents_modal_dialog_manager->WillClose(this); | 649 web_contents_modal_dialog_manager->WillClose(this); |
| 651 } | 650 } |
| 652 | 651 |
| 653 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { | 652 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { |
| 654 Activate(); | 653 Activate(); |
| 655 } | 654 } |
| 656 | 655 |
| 657 views::internal::NativeWidgetDelegate* | 656 views::internal::NativeWidgetDelegate* |
| 658 ConstrainedWindowViews::AsNativeWidgetDelegate() { | 657 ConstrainedWindowViews::AsNativeWidgetDelegate() { |
| 659 return this; | 658 return this; |
| 660 } | 659 } |
| 661 | 660 |
| 662 int ConstrainedWindowViews::GetNonClientComponent(const gfx::Point& point) { | 661 int ConstrainedWindowViews::GetNonClientComponent(const gfx::Point& point) { |
| 663 // Prevent a constrained window to be moved by the user. | 662 // Prevent a constrained window to be moved by the user. |
| 664 return HTNOWHERE; | 663 return HTNOWHERE; |
| 665 } | 664 } |
| OLD | NEW |