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

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

Issue 8833004: Remove BubbleDelegateView ctor color arg, add simple setter/getter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass set_color SkColor arg by value. Created 9 years 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/page_info_bubble_view.h" 5 #include "chrome/browser/ui/views/page_info_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/certificate_viewer.h" 10 #include "chrome/browser/certificate_viewer.h"
(...skipping 12 matching lines...) Expand all
23 #include "ui/gfx/image/image.h" 23 #include "ui/gfx/image/image.h"
24 #include "ui/views/controls/image_view.h" 24 #include "ui/views/controls/image_view.h"
25 #include "ui/views/controls/label.h" 25 #include "ui/views/controls/label.h"
26 #include "ui/views/controls/link.h" 26 #include "ui/views/controls/link.h"
27 #include "ui/views/controls/separator.h" 27 #include "ui/views/controls/separator.h"
28 #include "ui/views/layout/grid_layout.h" 28 #include "ui/views/layout/grid_layout.h"
29 #include "ui/views/widget/widget.h" 29 #include "ui/views/widget/widget.h"
30 30
31 namespace { 31 namespace {
32 32
33 // TODO(msw): Get color from theme/window color.
34 const SkColor kColor = SK_ColorWHITE;
35
36 // Layout constants. 33 // Layout constants.
37 const int kHGapToBorder = 11; 34 const int kHGapToBorder = 11;
38 const int kVerticalSectionPadding = 8; 35 const int kVerticalSectionPadding = 8;
39 const int kVGapToHeadline = 5; 36 const int kVGapToHeadline = 5;
40 const int kHGapImageToDescription = 6; 37 const int kHGapImageToDescription = 6;
41 const int kTextPaddingRight = 10; 38 const int kTextPaddingRight = 10;
42 const int kPaddingBelowSeparator = 6; 39 const int kPaddingBelowSeparator = 6;
43 const int kPaddingAboveSeparator = 4; 40 const int kPaddingAboveSeparator = 4;
44 const int kIconHorizontalOffset = 27; 41 const int kIconHorizontalOffset = 27;
45 const int kIconVerticalOffset = -7; 42 const int kIconVerticalOffset = -7;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } // namespace 96 } // namespace
100 97
101 //////////////////////////////////////////////////////////////////////////////// 98 ////////////////////////////////////////////////////////////////////////////////
102 // PageInfoBubbleView 99 // PageInfoBubbleView
103 100
104 PageInfoBubbleView::PageInfoBubbleView(views::View* anchor_view, 101 PageInfoBubbleView::PageInfoBubbleView(views::View* anchor_view,
105 Profile* profile, 102 Profile* profile,
106 const GURL& url, 103 const GURL& url,
107 const NavigationEntry::SSLStatus& ssl, 104 const NavigationEntry::SSLStatus& ssl,
108 bool show_history) 105 bool show_history)
109 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT, kColor), 106 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT),
110 ALLOW_THIS_IN_INITIALIZER_LIST(model_(profile, url, ssl, 107 ALLOW_THIS_IN_INITIALIZER_LIST(model_(profile, url, ssl,
111 show_history, this)), 108 show_history, this)),
112 cert_id_(ssl.cert_id()), 109 cert_id_(ssl.cert_id()),
113 help_center_link_(NULL), 110 help_center_link_(NULL),
114 ALLOW_THIS_IN_INITIALIZER_LIST(resize_animation_(this)), 111 ALLOW_THIS_IN_INITIALIZER_LIST(resize_animation_(this)),
115 animation_start_height_(0) { 112 animation_start_height_(0) {
116 113
117 if (cert_id_ > 0) { 114 if (cert_id_ > 0) {
118 scoped_refptr<net::X509Certificate> cert; 115 scoped_refptr<net::X509Certificate> cert;
119 CertStore::GetInstance()->RetrieveCert(cert_id_, &cert); 116 CertStore::GetInstance()->RetrieveCert(cert_id_, &cert);
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 const GURL& url, 473 const GURL& url,
477 const NavigationEntry::SSLStatus& ssl, 474 const NavigationEntry::SSLStatus& ssl,
478 bool show_history) { 475 bool show_history) {
479 PageInfoBubbleView* page_info_bubble = 476 PageInfoBubbleView* page_info_bubble =
480 new PageInfoBubbleView(anchor_view, profile, url, ssl, show_history); 477 new PageInfoBubbleView(anchor_view, profile, url, ssl, show_history);
481 browser::CreateViewsBubble(page_info_bubble); 478 browser::CreateViewsBubble(page_info_bubble);
482 page_info_bubble->Show(); 479 page_info_bubble->Show();
483 } 480 }
484 481
485 } 482 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/global_error_bubble_view.cc ('k') | chrome/browser/ui/views/web_intent_picker_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698