Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: chrome/browser/ui/views/about_chrome_view.cc

Issue 9837059: Cleanup for views::Label: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/about_chrome_view.h" 5 #include "chrome/browser/ui/views/about_chrome_view.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <commdlg.h> 8 #include <commdlg.h>
9 #endif // defined(OS_WIN) 9 #endif // defined(OS_WIN)
10 10
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 SkColor background_color = color_utils::GetSysSkColor(COLOR_3DFACE); 249 SkColor background_color = color_utils::GetSysSkColor(COLOR_3DFACE);
250 copyright_label_->SetBackgroundColor(background_color); 250 copyright_label_->SetBackgroundColor(background_color);
251 main_text_label_->SetBackgroundColor(background_color); 251 main_text_label_->SetBackgroundColor(background_color);
252 chromium_url_->SetBackgroundColor(background_color); 252 chromium_url_->SetBackgroundColor(background_color);
253 open_source_url_->SetBackgroundColor(background_color); 253 open_source_url_->SetBackgroundColor(background_color);
254 #endif 254 #endif
255 255
256 // Add together all the strings in the dialog for the purpose of calculating 256 // Add together all the strings in the dialog for the purpose of calculating
257 // the height of the dialog. The space for the Terms of Service string is not 257 // the height of the dialog. The space for the Terms of Service string is not
258 // included (it is added later, if needed). 258 // included (it is added later, if needed).
259 string16 full_text = main_label_chunk1_ + chromium_url_->GetText() + 259 string16 full_text = main_label_chunk1_ + chromium_url_->text() +
260 main_label_chunk2_ + open_source_url_->GetText() + 260 main_label_chunk2_ + open_source_url_->text() +
261 main_label_chunk3_; 261 main_label_chunk3_;
262 262
263 dialog_dimensions_ = views::Widget::GetLocalizedContentsSize( 263 dialog_dimensions_ = views::Widget::GetLocalizedContentsSize(
264 IDS_ABOUT_DIALOG_WIDTH_CHARS, 264 IDS_ABOUT_DIALOG_WIDTH_CHARS,
265 IDS_ABOUT_DIALOG_MINIMUM_HEIGHT_LINES); 265 IDS_ABOUT_DIALOG_MINIMUM_HEIGHT_LINES);
266 266
267 // Create a label and add the full text so we can query it for the height. 267 // Create a label and add the full text so we can query it for the height.
268 views::Label dummy_text(full_text); 268 views::Label dummy_text(full_text);
269 dummy_text.SetMultiLine(true); 269 dummy_text.SetMultiLine(true);
270 gfx::Font font = 270 gfx::Font font =
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 // We have updated controls on the parent, so we need to update its layout. 780 // We have updated controls on the parent, so we need to update its layout.
781 parent()->Layout(); 781 parent()->Layout();
782 782
783 // Check button may have appeared/disappeared. We cannot call this during 783 // Check button may have appeared/disappeared. We cannot call this during
784 // ViewHierarchyChanged because the view hasn't been added to a Widget yet. 784 // ViewHierarchyChanged because the view hasn't been added to a Widget yet.
785 if (GetWidget()) 785 if (GetWidget())
786 GetDialogClientView()->UpdateDialogButtons(); 786 GetDialogClientView()->UpdateDialogButtons();
787 } 787 }
788 788
789 int AboutChromeView::EnlargeWindowSizeIfNeeded() { 789 int AboutChromeView::EnlargeWindowSizeIfNeeded() {
790 if (!error_label_ || error_label_->GetText().empty()) 790 if (!error_label_ || error_label_->text().empty())
791 return 0; 791 return 0;
792 792
793 // This will enlarge the window each time the function is called, which is 793 // This will enlarge the window each time the function is called, which is
794 // fine since we only receive status once from Google Update. 794 // fine since we only receive status once from Google Update.
795 gfx::Rect window_rect = GetWidget()->GetWindowScreenBounds(); 795 gfx::Rect window_rect = GetWidget()->GetWindowScreenBounds();
796 int height = error_label_->GetHeightForWidth( 796 int height = error_label_->GetHeightForWidth(
797 dialog_dimensions_.width() - (2 * views::kPanelHorizMargin)) + 797 dialog_dimensions_.width() - (2 * views::kPanelHorizMargin)) +
798 views::kRelatedControlVerticalSpacing; 798 views::kRelatedControlVerticalSpacing;
799 window_rect.set_height(window_rect.height() + height); 799 window_rect.set_height(window_rect.height() + height);
800 GetWidget()->SetBounds(window_rect); 800 GetWidget()->SetBounds(window_rect);
801 801
802 return height; 802 return height;
803 } 803 }
804 804
805 #endif 805 #endif
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/status/status_area_bubble.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698