Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/about_chrome_view.h" | 5 #include "chrome/browser/views/about_chrome_view.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/color_utils.h" | 8 #include "app/gfx/color_utils.h" |
| 9 #include "base/i18n/word_iterator.h" | 9 #include "base/i18n/word_iterator.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 479 | 479 |
| 480 run_start = run_end; // Advance over what we just drew. | 480 run_start = run_end; // Advance over what we just drew. |
| 481 } | 481 } |
| 482 | 482 |
| 483 // If the caller is interested in placing a link after this text blurb, we | 483 // If the caller is interested in placing a link after this text blurb, we |
| 484 // figure out here where to place it. | 484 // figure out here where to place it. |
| 485 if (link && rect) { | 485 if (link && rect) { |
| 486 gfx::Size sz = link->GetPreferredSize(); | 486 gfx::Size sz = link->GetPreferredSize(); |
| 487 gfx::Insets insets = link->GetInsets(); | 487 gfx::Insets insets = link->GetInsets(); |
| 488 WrapIfWordDoesntFit(sz.width(), font.height(), position, bounds); | 488 WrapIfWordDoesntFit(sz.width(), font.height(), position, bounds); |
| 489 *rect = gfx::Rect(position->width(), position->height() - insets.top(), | 489 int x = position->width(); |
| 490 sz.width(), sz.height()); | 490 int y = position->height(); |
|
Evan Stade
2009/10/23 18:06:29
is there a functional change here?
DaveMoore
2009/10/23 18:11:10
No...making it more readable.
| |
| 491 | |
| 492 // Links have a border to allow them to be focused. | |
| 493 y -= insets.top(); | |
| 494 | |
| 495 *rect = gfx::Rect(x, y, sz.width(), sz.height()); | |
| 491 | 496 |
| 492 // Go from relative pixel coordinates (within the label we are drawing on) | 497 // Go from relative pixel coordinates (within the label we are drawing on) |
| 493 // to absolute pixel coordinates (relative to the top left corner of the | 498 // to absolute pixel coordinates (relative to the top left corner of the |
| 494 // dialog content). | 499 // dialog content). |
| 495 rect->Offset(bounds.x(), bounds.y()); | 500 rect->Offset(bounds.x(), bounds.y()); |
| 496 // And leave some space to draw the link in. | 501 // And leave some space to draw the link in. |
| 497 position->Enlarge(sz.width(), 0); | 502 position->Enlarge(sz.width(), 0); |
| 498 } | 503 } |
| 499 } | 504 } |
| 500 | 505 |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 View* parent = GetParent(); | 857 View* parent = GetParent(); |
| 853 parent->Layout(); | 858 parent->Layout(); |
| 854 | 859 |
| 855 // Check button may have appeared/disappeared. We cannot call this during | 860 // Check button may have appeared/disappeared. We cannot call this during |
| 856 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. | 861 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. |
| 857 if (window()) | 862 if (window()) |
| 858 GetDialogClientView()->UpdateDialogButtons(); | 863 GetDialogClientView()->UpdateDialogButtons(); |
| 859 } | 864 } |
| 860 | 865 |
| 861 #endif | 866 #endif |
| OLD | NEW |