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

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

Issue 6452011: Rework tree APIs to reflect Google style and more const-correctness.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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) 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/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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 // Then the main_text_label. 386 // Then the main_text_label.
387 main_text_label_->SetBounds(kPanelHorizMargin, 387 main_text_label_->SetBounds(kPanelHorizMargin,
388 copyright_label_->y() + 388 copyright_label_->y() +
389 copyright_label_->height(), 389 copyright_label_->height(),
390 sz.width(), 390 sz.width(),
391 main_text_label_height_); 391 main_text_label_height_);
392 392
393 // Get the y-coordinate of our parent so we can position the text left of the 393 // Get the y-coordinate of our parent so we can position the text left of the
394 // buttons at the bottom. 394 // buttons at the bottom.
395 gfx::Rect parent_bounds = GetParent()->GetLocalBounds(); 395 gfx::Rect parent_bounds = parent()->GetLocalBounds();
396 396
397 sz = throbber_->GetPreferredSize(); 397 sz = throbber_->GetPreferredSize();
398 int throbber_topleft_x = kPanelHorizMargin; 398 int throbber_topleft_x = kPanelHorizMargin;
399 int throbber_topleft_y = 399 int throbber_topleft_y =
400 parent_bounds.bottom() - sz.height() - views::kButtonVEdgeMargin - 3; 400 parent_bounds.bottom() - sz.height() - views::kButtonVEdgeMargin - 3;
401 throbber_->SetBounds(throbber_topleft_x, throbber_topleft_y, 401 throbber_->SetBounds(throbber_topleft_x, throbber_topleft_y,
402 sz.width(), sz.height()); 402 sz.width(), sz.height());
403 403
404 // This image is hidden (see ViewHierarchyChanged) and displayed on demand. 404 // This image is hidden (see ViewHierarchyChanged) and displayed on demand.
405 sz = success_indicator_.GetPreferredSize(); 405 sz = success_indicator_.GetPreferredSize();
(...skipping 16 matching lines...) Expand all
422 sz = update_label_.GetPreferredSize(); 422 sz = update_label_.GetPreferredSize();
423 int update_label_x = throbber_->x() + throbber_->width() + 423 int update_label_x = throbber_->x() + throbber_->width() +
424 kRelatedControlHorizontalSpacing; 424 kRelatedControlHorizontalSpacing;
425 update_label_.SetHorizontalAlignment(views::Label::ALIGN_LEFT); 425 update_label_.SetHorizontalAlignment(views::Label::ALIGN_LEFT);
426 update_label_.SetBounds(update_label_x, 426 update_label_.SetBounds(update_label_x,
427 throbber_topleft_y + 1, 427 throbber_topleft_y + 1,
428 parent_bounds.width() - update_label_x, 428 parent_bounds.width() - update_label_x,
429 sz.height()); 429 sz.height());
430 430
431 if (!accessible_view_helper_.get()) 431 if (!accessible_view_helper_.get())
432 accessible_view_helper_.reset( 432 accessible_view_helper_.reset(new AccessibleViewHelper(parent(), profile_));
433 new AccessibleViewHelper(GetParent(), profile_));
434 } 433 }
435 434
436 435
437 void AboutChromeView::Paint(gfx::Canvas* canvas) { 436 void AboutChromeView::Paint(gfx::Canvas* canvas) {
438 views::View::Paint(canvas); 437 views::View::Paint(canvas);
439 438
440 // Draw the background image color (and the separator) across the dialog. 439 // Draw the background image color (and the separator) across the dialog.
441 // This will become the background for the logo image at the top of the 440 // This will become the background for the logo image at the top of the
442 // dialog. 441 // dialog.
443 canvas->TileImageInt(*kBackgroundBmp, 0, 0, 442 canvas->TileImageInt(*kBackgroundBmp, 0, 0,
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 update_available_indicator_.SetVisible(show_update_available_indicator); 822 update_available_indicator_.SetVisible(show_update_available_indicator);
824 timeout_indicator_.SetVisible(show_timeout_indicator); 823 timeout_indicator_.SetVisible(show_timeout_indicator);
825 update_label_.SetVisible(show_update_label); 824 update_label_.SetVisible(show_update_label);
826 throbber_->SetVisible(show_throbber); 825 throbber_->SetVisible(show_throbber);
827 if (show_throbber) 826 if (show_throbber)
828 throbber_->Start(); 827 throbber_->Start();
829 else 828 else
830 throbber_->Stop(); 829 throbber_->Stop();
831 830
832 // We have updated controls on the parent, so we need to update its layout. 831 // We have updated controls on the parent, so we need to update its layout.
833 View* parent = GetParent(); 832 parent()->Layout();
834 parent->Layout();
835 833
836 // Check button may have appeared/disappeared. We cannot call this during 834 // Check button may have appeared/disappeared. We cannot call this during
837 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. 835 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet.
838 if (window()) 836 if (window())
839 GetDialogClientView()->UpdateDialogButtons(); 837 GetDialogClientView()->UpdateDialogButtons();
840 } 838 }
841 839
842 #endif 840 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/accessibility_event_router_views.cc » ('j') | views/accessibility/view_accessibility.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698