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

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

Issue 6312160: Map Views to Profiles directly from their window, eliminating the need... (Closed) Base URL: svn://chrome-svn/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
11 #include <algorithm> 11 #include <algorithm>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/callback.h" 15 #include "base/callback.h"
16 #include "base/i18n/rtl.h" 16 #include "base/i18n/rtl.h"
17 #include "base/string_number_conversions.h" 17 #include "base/string_number_conversions.h"
18 #include "base/utf_string_conversions.h" 18 #include "base/utf_string_conversions.h"
19 #include "base/win/windows_version.h" 19 #include "base/win/windows_version.h"
20 #include "chrome/browser/browser_list.h" 20 #include "chrome/browser/browser_list.h"
21 #include "chrome/browser/google/google_util.h" 21 #include "chrome/browser/google/google_util.h"
22 #include "chrome/browser/metrics/user_metrics.h" 22 #include "chrome/browser/metrics/user_metrics.h"
23 #include "chrome/browser/platform_util.h" 23 #include "chrome/browser/platform_util.h"
24 #include "chrome/browser/prefs/pref_service.h" 24 #include "chrome/browser/prefs/pref_service.h"
25 #include "chrome/browser/ui/views/accessible_view_helper.h"
26 #include "chrome/browser/ui/views/window.h" 25 #include "chrome/browser/ui/views/window.h"
27 #include "chrome/common/chrome_constants.h" 26 #include "chrome/common/chrome_constants.h"
28 #include "chrome/common/chrome_version_info.h" 27 #include "chrome/common/chrome_version_info.h"
29 #include "chrome/common/pref_names.h" 28 #include "chrome/common/pref_names.h"
30 #include "chrome/common/url_constants.h" 29 #include "chrome/common/url_constants.h"
31 #include "chrome/installer/util/browser_distribution.h" 30 #include "chrome/installer/util/browser_distribution.h"
32 #include "grit/chromium_strings.h" 31 #include "grit/chromium_strings.h"
33 #include "grit/generated_resources.h" 32 #include "grit/generated_resources.h"
34 #include "grit/locale_settings.h" 33 #include "grit/locale_settings.h"
35 #include "grit/theme_resources.h" 34 #include "grit/theme_resources.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 // the throbber. We specify width to the end of the dialog because it contains 419 // the throbber. We specify width to the end of the dialog because it contains
421 // variable length messages. 420 // variable length messages.
422 sz = update_label_.GetPreferredSize(); 421 sz = update_label_.GetPreferredSize();
423 int update_label_x = throbber_->x() + throbber_->width() + 422 int update_label_x = throbber_->x() + throbber_->width() +
424 kRelatedControlHorizontalSpacing; 423 kRelatedControlHorizontalSpacing;
425 update_label_.SetHorizontalAlignment(views::Label::ALIGN_LEFT); 424 update_label_.SetHorizontalAlignment(views::Label::ALIGN_LEFT);
426 update_label_.SetBounds(update_label_x, 425 update_label_.SetBounds(update_label_x,
427 throbber_topleft_y + 1, 426 throbber_topleft_y + 1,
428 parent_bounds.width() - update_label_x, 427 parent_bounds.width() - update_label_x,
429 sz.height()); 428 sz.height());
430
431 if (!accessible_view_helper_.get())
432 accessible_view_helper_.reset(
433 new AccessibleViewHelper(GetParent(), profile_));
434 } 429 }
435 430
436 431
437 void AboutChromeView::Paint(gfx::Canvas* canvas) { 432 void AboutChromeView::Paint(gfx::Canvas* canvas) {
438 views::View::Paint(canvas); 433 views::View::Paint(canvas);
439 434
440 // Draw the background image color (and the separator) across the dialog. 435 // 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 436 // This will become the background for the logo image at the top of the
442 // dialog. 437 // dialog.
443 canvas->TileImageInt(*kBackgroundBmp, 0, 0, 438 canvas->TileImageInt(*kBackgroundBmp, 0, 0,
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 View* parent = GetParent(); 828 View* parent = GetParent();
834 parent->Layout(); 829 parent->Layout();
835 830
836 // Check button may have appeared/disappeared. We cannot call this during 831 // Check button may have appeared/disappeared. We cannot call this during
837 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. 832 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet.
838 if (window()) 833 if (window())
839 GetDialogClientView()->UpdateDialogButtons(); 834 GetDialogClientView()->UpdateDialogButtons();
840 } 835 }
841 836
842 #endif 837 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/about_chrome_view.h ('k') | chrome/browser/ui/views/accessibility_event_router_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698