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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 #if defined(USE_ASH) | 605 #if defined(USE_ASH) |
606 // We don't necessarily have a RootWindow yet. | 606 // We don't necessarily have a RootWindow yet. |
607 if (GetNativeView()->GetRootWindow()) | 607 if (GetNativeView()->GetRootWindow()) |
608 GetNativeView()->Focus(); | 608 GetNativeView()->Focus(); |
609 #endif | 609 #endif |
610 } | 610 } |
611 | 611 |
612 void ConstrainedWindowViews::PulseWebContentsModalDialog() { | 612 void ConstrainedWindowViews::PulseWebContentsModalDialog() { |
613 } | 613 } |
614 | 614 |
615 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() { | 615 NativeWebContentsModalDialog ConstrainedWindowViews::GetNativeDialog() { |
616 return Widget::GetNativeWindow(); | 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->GetNativeView(), |
626 web_contents->GetBrowserContext()->IsOffTheRecord(), | 626 web_contents->GetBrowserContext()->IsOffTheRecord(), |
627 widget_delegate); | 627 widget_delegate); |
628 manager->AddDialog(dialog); | 628 manager->AddDialog(dialog); |
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 |