| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/constrained_window_impl.h" | 5 #include "chrome/browser/views/constrained_window_impl.h" |
| 6 | 6 |
| 7 #include "app/gfx/chrome_canvas.h" | 7 #include "app/gfx/chrome_canvas.h" |
| 8 #include "app/gfx/chrome_font.h" | 8 #include "app/gfx/chrome_font.h" |
| 9 #include "app/gfx/path.h" | 9 #include "app/gfx/path.h" |
| 10 #include "app/gfx/text_elider.h" | 10 #include "app/gfx/text_elider.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 gfx::Rect title_bounds_; | 230 gfx::Rect title_bounds_; |
| 231 | 231 |
| 232 views::ImageButton* close_button_; | 232 views::ImageButton* close_button_; |
| 233 | 233 |
| 234 // The bounds of the ClientView. | 234 // The bounds of the ClientView. |
| 235 gfx::Rect client_view_bounds_; | 235 gfx::Rect client_view_bounds_; |
| 236 | 236 |
| 237 static void InitClass(); | 237 static void InitClass(); |
| 238 | 238 |
| 239 // The font to be used to render the titlebar text. | 239 // The font to be used to render the titlebar text. |
| 240 static ChromeFont* title_font_; | 240 static gfx::Font* title_font_; |
| 241 | 241 |
| 242 DISALLOW_EVIL_CONSTRUCTORS(ConstrainedWindowFrameView); | 242 DISALLOW_EVIL_CONSTRUCTORS(ConstrainedWindowFrameView); |
| 243 }; | 243 }; |
| 244 | 244 |
| 245 ChromeFont* ConstrainedWindowFrameView::title_font_ = NULL; | 245 gfx::Font* ConstrainedWindowFrameView::title_font_ = NULL; |
| 246 | 246 |
| 247 namespace { | 247 namespace { |
| 248 // The frame border is only visible in restored mode and is hardcoded to 4 px on | 248 // The frame border is only visible in restored mode and is hardcoded to 4 px on |
| 249 // each side regardless of the system window border size. | 249 // each side regardless of the system window border size. |
| 250 const int kFrameBorderThickness = 4; | 250 const int kFrameBorderThickness = 4; |
| 251 // Various edges of the frame border have a 1 px shadow along their edges; in a | 251 // Various edges of the frame border have a 1 px shadow along their edges; in a |
| 252 // few cases we shift elements based on this amount for visual appeal. | 252 // few cases we shift elements based on this amount for visual appeal. |
| 253 const int kFrameShadowThickness = 1; | 253 const int kFrameShadowThickness = 1; |
| 254 // In the window corners, the resize areas don't actually expand bigger, but the | 254 // In the window corners, the resize areas don't actually expand bigger, but the |
| 255 // 16 px at the end of each edge triggers diagonal resizing. | 255 // 16 px at the end of each edge triggers diagonal resizing. |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 resources_.reset(new VistaWindowResources); | 561 resources_.reset(new VistaWindowResources); |
| 562 } else { | 562 } else { |
| 563 resources_.reset(new XPWindowResources); | 563 resources_.reset(new XPWindowResources); |
| 564 } | 564 } |
| 565 } | 565 } |
| 566 | 566 |
| 567 // static | 567 // static |
| 568 void ConstrainedWindowFrameView::InitClass() { | 568 void ConstrainedWindowFrameView::InitClass() { |
| 569 static bool initialized = false; | 569 static bool initialized = false; |
| 570 if (!initialized) { | 570 if (!initialized) { |
| 571 title_font_ = new ChromeFont(win_util::GetWindowTitleFont()); | 571 title_font_ = new gfx::Font(win_util::GetWindowTitleFont()); |
| 572 | 572 |
| 573 initialized = true; | 573 initialized = true; |
| 574 } | 574 } |
| 575 } | 575 } |
| 576 | 576 |
| 577 //////////////////////////////////////////////////////////////////////////////// | 577 //////////////////////////////////////////////////////////////////////////////// |
| 578 // ConstrainedWindowImpl, public: | 578 // ConstrainedWindowImpl, public: |
| 579 | 579 |
| 580 // The space (in pixels) between minimized pop-ups stacked horizontally and | 580 // The space (in pixels) between minimized pop-ups stacked horizontally and |
| 581 // vertically. | 581 // vertically. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( | 735 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( |
| 736 TabContents* parent, | 736 TabContents* parent, |
| 737 const gfx::Rect& initial_bounds, | 737 const gfx::Rect& initial_bounds, |
| 738 views::View* contents_view, | 738 views::View* contents_view, |
| 739 views::WindowDelegate* window_delegate) { | 739 views::WindowDelegate* window_delegate) { |
| 740 ConstrainedWindowImpl* window = new ConstrainedWindowImpl(parent, | 740 ConstrainedWindowImpl* window = new ConstrainedWindowImpl(parent, |
| 741 window_delegate); | 741 window_delegate); |
| 742 window->InitAsDialog(initial_bounds); | 742 window->InitAsDialog(initial_bounds); |
| 743 return window; | 743 return window; |
| 744 } | 744 } |
| OLD | NEW |