OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_win.h" | 5 #include "chrome/browser/ui/views/constrained_window_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/win/win_util.h" | |
10 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/tab_contents/tab_contents.h" | 11 #include "chrome/browser/tab_contents/tab_contents.h" |
13 #include "chrome/browser/tab_contents/tab_contents_view.h" | 12 #include "chrome/browser/tab_contents/tab_contents_view.h" |
14 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 13 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
15 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
16 #include "chrome/browser/ui/window_sizer.h" | 15 #include "chrome/browser/ui/window_sizer.h" |
17 #include "chrome/common/chrome_constants.h" | 16 #include "chrome/common/chrome_constants.h" |
18 #include "chrome/common/notification_service.h" | 17 #include "chrome/common/notification_service.h" |
19 #include "gfx/canvas.h" | 18 #include "gfx/canvas.h" |
20 #include "gfx/font.h" | 19 #include "gfx/font.h" |
21 #include "gfx/path.h" | 20 #include "gfx/path.h" |
22 #include "gfx/rect.h" | 21 #include "gfx/rect.h" |
23 #include "grit/app_resources.h" | 22 #include "grit/app_resources.h" |
24 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
25 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
26 #include "grit/theme_resources.h" | 25 #include "grit/theme_resources.h" |
27 #include "net/base/net_util.h" | 26 #include "net/base/net_util.h" |
28 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
29 #include "views/controls/button/image_button.h" | 28 #include "views/controls/button/image_button.h" |
30 #include "views/focus/focus_manager.h" | 29 #include "views/focus/focus_manager.h" |
31 #include "views/widget/widget_win.h" | 30 #include "views/widget/widget_win.h" |
32 #include "views/window/client_view.h" | 31 #include "views/window/client_view.h" |
33 #include "views/window/non_client_view.h" | 32 #include "views/window/non_client_view.h" |
34 #include "views/window/window_resources.h" | 33 #include "views/window/window_resources.h" |
35 #include "views/window/window_shape.h" | 34 #include "views/window/window_shape.h" |
| 35 #include "views/window/window_win.h" |
36 | 36 |
37 using base::TimeDelta; | 37 using base::TimeDelta; |
38 | 38 |
39 namespace views { | 39 namespace views { |
40 class ClientView; | 40 class ClientView; |
41 } | 41 } |
42 | 42 |
43 // An enumeration of bitmap resources used by this window. | 43 // An enumeration of bitmap resources used by this window. |
44 enum { | 44 enum { |
45 FRAME_PART_BITMAP_FIRST = 0, // Must be first. | 45 FRAME_PART_BITMAP_FIRST = 0, // Must be first. |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 void ConstrainedWindowFrameView::InitWindowResources() { | 538 void ConstrainedWindowFrameView::InitWindowResources() { |
539 resources_.reset(views::WidgetWin::IsAeroGlassEnabled() ? | 539 resources_.reset(views::WidgetWin::IsAeroGlassEnabled() ? |
540 static_cast<views::WindowResources*>(new VistaWindowResources) : | 540 static_cast<views::WindowResources*>(new VistaWindowResources) : |
541 new XPWindowResources); | 541 new XPWindowResources); |
542 } | 542 } |
543 | 543 |
544 // static | 544 // static |
545 void ConstrainedWindowFrameView::InitClass() { | 545 void ConstrainedWindowFrameView::InitClass() { |
546 static bool initialized = false; | 546 static bool initialized = false; |
547 if (!initialized) { | 547 if (!initialized) { |
548 title_font_ = new gfx::Font(app::win::GetWindowTitleFont()); | 548 title_font_ = new gfx::Font(views::WindowWin::GetWindowTitleFont()); |
549 initialized = true; | 549 initialized = true; |
550 } | 550 } |
551 } | 551 } |
552 | 552 |
553 //////////////////////////////////////////////////////////////////////////////// | 553 //////////////////////////////////////////////////////////////////////////////// |
554 // ConstrainedWindowWin, public: | 554 // ConstrainedWindowWin, public: |
555 | 555 |
556 ConstrainedWindowWin::~ConstrainedWindowWin() { | 556 ConstrainedWindowWin::~ConstrainedWindowWin() { |
557 } | 557 } |
558 | 558 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 | 672 |
673 | 673 |
674 // static | 674 // static |
675 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( | 675 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( |
676 TabContents* parent, | 676 TabContents* parent, |
677 views::WindowDelegate* window_delegate) { | 677 views::WindowDelegate* window_delegate) { |
678 ConstrainedWindowWin* window = new ConstrainedWindowWin(parent, | 678 ConstrainedWindowWin* window = new ConstrainedWindowWin(parent, |
679 window_delegate); | 679 window_delegate); |
680 return window; | 680 return window; |
681 } | 681 } |
OLD | NEW |