| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_win.h" | 5 #include "chrome/browser/views/constrained_window_win.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "app/text_elider.h" | 9 #include "app/text_elider.h" |
| 10 #include "app/win_util.h" | 10 #include "app/win_util.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 virtual gfx::Rect GetWindowBoundsForClientBounds( | 171 virtual gfx::Rect GetWindowBoundsForClientBounds( |
| 172 const gfx::Rect& client_bounds) const; | 172 const gfx::Rect& client_bounds) const; |
| 173 virtual int NonClientHitTest(const gfx::Point& point); | 173 virtual int NonClientHitTest(const gfx::Point& point); |
| 174 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); | 174 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); |
| 175 virtual void EnableClose(bool enable); | 175 virtual void EnableClose(bool enable); |
| 176 virtual void ResetWindowControls() { } | 176 virtual void ResetWindowControls() { } |
| 177 | 177 |
| 178 // Overridden from views::View: | 178 // Overridden from views::View: |
| 179 virtual void Paint(gfx::Canvas* canvas); | 179 virtual void Paint(gfx::Canvas* canvas); |
| 180 virtual void Layout(); | 180 virtual void Layout(); |
| 181 virtual void ThemeChanged(); | 181 virtual void OnThemeChanged(); |
| 182 | 182 |
| 183 // Overridden from views::ButtonListener: | 183 // Overridden from views::ButtonListener: |
| 184 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 184 virtual void ButtonPressed(views::Button* sender, const views::Event& event); |
| 185 | 185 |
| 186 private: | 186 private: |
| 187 // Returns the thickness of the entire nonclient left, right, and bottom | 187 // Returns the thickness of the entire nonclient left, right, and bottom |
| 188 // borders, including both the window frame and any client edge. | 188 // borders, including both the window frame and any client edge. |
| 189 int NonClientBorderThickness() const; | 189 int NonClientBorderThickness() const; |
| 190 | 190 |
| 191 // Returns the height of the entire nonclient top border, including the window | 191 // Returns the height of the entire nonclient top border, including the window |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 PaintTitleBar(canvas); | 365 PaintTitleBar(canvas); |
| 366 PaintClientEdge(canvas); | 366 PaintClientEdge(canvas); |
| 367 } | 367 } |
| 368 | 368 |
| 369 void ConstrainedWindowFrameView::Layout() { | 369 void ConstrainedWindowFrameView::Layout() { |
| 370 LayoutWindowControls(); | 370 LayoutWindowControls(); |
| 371 LayoutTitleBar(); | 371 LayoutTitleBar(); |
| 372 client_view_bounds_ = CalculateClientAreaBounds(width(), height()); | 372 client_view_bounds_ = CalculateClientAreaBounds(width(), height()); |
| 373 } | 373 } |
| 374 | 374 |
| 375 void ConstrainedWindowFrameView::ThemeChanged() { | 375 void ConstrainedWindowFrameView::OnThemeChanged() { |
| 376 InitWindowResources(); | 376 InitWindowResources(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 //////////////////////////////////////////////////////////////////////////////// | 379 //////////////////////////////////////////////////////////////////////////////// |
| 380 // ConstrainedWindowFrameView, views::ButtonListener implementation: | 380 // ConstrainedWindowFrameView, views::ButtonListener implementation: |
| 381 | 381 |
| 382 void ConstrainedWindowFrameView::ButtonPressed( | 382 void ConstrainedWindowFrameView::ButtonPressed( |
| 383 views::Button* sender, const views::Event& event) { | 383 views::Button* sender, const views::Event& event) { |
| 384 if (sender == close_button_) | 384 if (sender == close_button_) |
| 385 container_->ExecuteSystemMenuCommand(SC_CLOSE); | 385 container_->ExecuteSystemMenuCommand(SC_CLOSE); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 | 679 |
| 680 | 680 |
| 681 // static | 681 // static |
| 682 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( | 682 ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( |
| 683 TabContents* parent, | 683 TabContents* parent, |
| 684 views::WindowDelegate* window_delegate) { | 684 views::WindowDelegate* window_delegate) { |
| 685 ConstrainedWindowWin* window = new ConstrainedWindowWin(parent, | 685 ConstrainedWindowWin* window = new ConstrainedWindowWin(parent, |
| 686 window_delegate); | 686 window_delegate); |
| 687 return window; | 687 return window; |
| 688 } | 688 } |
| OLD | NEW |