| 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 #if defined(USE_ASH) | 600 #if defined(USE_ASH) |
| 601 // We don't necessarily have a RootWindow yet. | 601 // We don't necessarily have a RootWindow yet. |
| 602 if (GetNativeView()->GetRootWindow()) | 602 if (GetNativeView()->GetRootWindow()) |
| 603 GetNativeView()->Focus(); | 603 GetNativeView()->Focus(); |
| 604 #endif | 604 #endif |
| 605 } | 605 } |
| 606 | 606 |
| 607 void ConstrainedWindowViews::PulseWebContentsModalDialog() { | 607 void ConstrainedWindowViews::PulseWebContentsModalDialog() { |
| 608 } | 608 } |
| 609 | 609 |
| 610 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() { | 610 gfx::NativeView ConstrainedWindowViews::GetNativeView() { |
| 611 return Widget::GetNativeWindow(); | 611 return Widget::GetNativeView(); |
| 612 } | 612 } |
| 613 | 613 |
| 614 ConstrainedWindowViews* ConstrainedWindowViews::Create( | 614 ConstrainedWindowViews* ConstrainedWindowViews::Create( |
| 615 content::WebContents* web_contents, | 615 content::WebContents* web_contents, |
| 616 views::WidgetDelegate* widget_delegate) { | 616 views::WidgetDelegate* widget_delegate) { |
| 617 WebContentsModalDialogManager* manager = | 617 WebContentsModalDialogManager* manager = |
| 618 WebContentsModalDialogManager::FromWebContents(web_contents); | 618 WebContentsModalDialogManager::FromWebContents(web_contents); |
| 619 ConstrainedWindowViews* dialog = new ConstrainedWindowViews( | 619 ConstrainedWindowViews* dialog = new ConstrainedWindowViews( |
| 620 web_contents->GetNativeView(), | 620 web_contents->GetNativeView(), |
| 621 web_contents->GetBrowserContext()->IsOffTheRecord(), | 621 web_contents->GetBrowserContext()->IsOffTheRecord(), |
| 622 widget_delegate); | 622 widget_delegate); |
| 623 manager->AddDialog(dialog); | 623 manager->AddDialog(dialog); |
| 624 return dialog; | 624 return dialog; |
| 625 } | 625 } |
| 626 | 626 |
| 627 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { | 627 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { |
| 628 if (views::DialogDelegate::UseNewStyle()) | 628 if (views::DialogDelegate::UseNewStyle()) |
| 629 return new views::DialogFrameView(widget_delegate()->GetWindowTitle()); | 629 return new views::DialogFrameView(widget_delegate()->GetWindowTitle()); |
| 630 #if defined(USE_ASH) | 630 #if defined(USE_ASH) |
| 631 ConstrainedWindowFrameViewAsh* frame = new ConstrainedWindowFrameViewAsh; | 631 ConstrainedWindowFrameViewAsh* frame = new ConstrainedWindowFrameViewAsh; |
| 632 frame->Init(this); | 632 frame->Init(this); |
| 633 return frame; | 633 return frame; |
| 634 #endif | 634 #endif |
| 635 return new ConstrainedWindowFrameView(this, off_the_record_); | 635 return new ConstrainedWindowFrameView(this, off_the_record_); |
| 636 } | 636 } |
| OLD | NEW |