| 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 NativeWebContentsModalDialog ConstrainedWindowViews::GetNativeDialog() { | 615 NativeWebContentsModalDialog ConstrainedWindowViews::GetNativeDialog() { |
| 616 return GetNativeView(); | 616 return GetNativeView(); |
| 617 } | 617 } |
| 618 | 618 |
| 619 ConstrainedWindowViews* ConstrainedWindowViews::Create( | 619 ConstrainedWindowViews* ConstrainedWindowViews::Create( |
| 620 content::WebContents* web_contents, | 620 content::WebContents* web_contents, |
| 621 views::WidgetDelegate* widget_delegate) { | 621 views::WidgetDelegate* widget_delegate) { |
| 622 WebContentsModalDialogManager* manager = | 622 WebContentsModalDialogManager* manager = |
| 623 WebContentsModalDialogManager::FromWebContents(web_contents); | 623 WebContentsModalDialogManager::FromWebContents(web_contents); |
| 624 ConstrainedWindowViews* dialog = new ConstrainedWindowViews( | 624 ConstrainedWindowViews* dialog = new ConstrainedWindowViews( |
| 625 web_contents->GetNativeView(), | 625 web_contents->GetView()->GetNativeView(), |
| 626 web_contents->GetBrowserContext()->IsOffTheRecord(), | 626 web_contents->GetBrowserContext()->IsOffTheRecord(), |
| 627 widget_delegate); | 627 widget_delegate); |
| 628 manager->AddDialog(dialog->GetNativeView()); | 628 manager->AddDialog(dialog->GetNativeView()); |
| 629 return dialog; | 629 return dialog; |
| 630 } | 630 } |
| 631 | 631 |
| 632 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { | 632 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { |
| 633 if (views::DialogDelegate::UseNewStyle()) | 633 if (views::DialogDelegate::UseNewStyle()) |
| 634 return views::DialogDelegate::CreateNewStyleFrameView(this); | 634 return views::DialogDelegate::CreateNewStyleFrameView(this); |
| 635 #if defined(USE_ASH) | 635 #if defined(USE_ASH) |
| 636 ConstrainedWindowFrameViewAsh* frame = new ConstrainedWindowFrameViewAsh; | 636 ConstrainedWindowFrameViewAsh* frame = new ConstrainedWindowFrameViewAsh; |
| 637 frame->Init(this); | 637 frame->Init(this); |
| 638 return frame; | 638 return frame; |
| 639 #endif | 639 #endif |
| 640 return new ConstrainedWindowFrameView(this, off_the_record_); | 640 return new ConstrainedWindowFrameView(this, off_the_record_); |
| 641 } | 641 } |
| OLD | NEW |