| 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/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) | 49 #if defined(USE_ASH) |
| 50 #include "ash/ash_switches.h" | 50 #include "ash/ash_switches.h" |
| 51 #include "ash/shell.h" | 51 #include "ash/shell.h" |
| 52 #include "ash/wm/custom_frame_view_ash.h" | 52 #include "ash/wm/custom_frame_view_ash.h" |
| 53 #include "base/command_line.h" | 53 #include "base/command_line.h" |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 using base::TimeDelta; | 56 using base::TimeDelta; |
| 57 | 57 |
| 58 namespace views { | 58 namespace views { |
| 59 class ClientView; | 59 class ClientView; |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 } | 620 } |
| 621 | 621 |
| 622 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() { | 622 gfx::NativeWindow ConstrainedWindowViews::GetNativeWindow() { |
| 623 return Widget::GetNativeWindow(); | 623 return Widget::GetNativeWindow(); |
| 624 } | 624 } |
| 625 | 625 |
| 626 //////////////////////////////////////////////////////////////////////////////// | 626 //////////////////////////////////////////////////////////////////////////////// |
| 627 // ConstrainedWindowViews, views::Widget overrides: | 627 // ConstrainedWindowViews, views::Widget overrides: |
| 628 | 628 |
| 629 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { | 629 views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() { |
| 630 #if defined(USE_AURA) | 630 #if defined(USE_ASH) |
| 631 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 631 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 632 if (command_line->HasSwitch(ash::switches::kAuraGoogleDialogFrames)) | 632 if (command_line->HasSwitch(ash::switches::kAuraGoogleDialogFrames)) |
| 633 return ash::Shell::GetInstance()->CreateDefaultNonClientFrameView(this); | 633 return ash::Shell::GetInstance()->CreateDefaultNonClientFrameView(this); |
| 634 ConstrainedWindowFrameViewAsh* frame = new ConstrainedWindowFrameViewAsh; | 634 ConstrainedWindowFrameViewAsh* frame = new ConstrainedWindowFrameViewAsh; |
| 635 frame->Init(this); | 635 frame->Init(this); |
| 636 return frame; | 636 return frame; |
| 637 #endif | 637 #endif |
| 638 return new ConstrainedWindowFrameView(this); | 638 return new ConstrainedWindowFrameView(this); |
| 639 } | 639 } |
| 640 | 640 |
| 641 //////////////////////////////////////////////////////////////////////////////// | 641 //////////////////////////////////////////////////////////////////////////////// |
| 642 // ConstrainedWindowViews, NativeConstrainedWindowDelegate implementation: | 642 // ConstrainedWindowViews, NativeConstrainedWindowDelegate implementation: |
| 643 | 643 |
| 644 void ConstrainedWindowViews::OnNativeConstrainedWindowDestroyed() { | 644 void ConstrainedWindowViews::OnNativeConstrainedWindowDestroyed() { |
| 645 wrapper_->constrained_window_tab_helper()->WillClose(this); | 645 wrapper_->constrained_window_tab_helper()->WillClose(this); |
| 646 } | 646 } |
| 647 | 647 |
| 648 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { | 648 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { |
| 649 Activate(); | 649 Activate(); |
| 650 } | 650 } |
| 651 | 651 |
| 652 views::internal::NativeWidgetDelegate* | 652 views::internal::NativeWidgetDelegate* |
| 653 ConstrainedWindowViews::AsNativeWidgetDelegate() { | 653 ConstrainedWindowViews::AsNativeWidgetDelegate() { |
| 654 return this; | 654 return this; |
| 655 } | 655 } |
| OLD | NEW |