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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view.cc

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/bookmarks/bookmark_sync_promo_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view.h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" 8 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h"
9 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 16 matching lines...) Expand all
27 const int kBorderWidth = 1; 27 const int kBorderWidth = 1;
28 28
29 // Color of the text of the promo. 29 // Color of the text of the promo.
30 const SkColor kTextColor = SkColorSetRGB(102, 102, 102); 30 const SkColor kTextColor = SkColorSetRGB(102, 102, 102);
31 31
32 } // namespace 32 } // namespace
33 33
34 BookmarkSyncPromoView::BookmarkSyncPromoView(BookmarkBubbleDelegate* delegate) 34 BookmarkSyncPromoView::BookmarkSyncPromoView(BookmarkBubbleDelegate* delegate)
35 : delegate_(delegate) { 35 : delegate_(delegate) {
36 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); 36 set_background(views::Background::CreateSolidBackground(kBackgroundColor));
37 set_border(views::Border::CreateSolidSidedBorder(kBorderWidth, 37 SetBorder(views::Border::CreateSolidSidedBorder(
38 0, 38 kBorderWidth, 0, 0, 0, kBorderColor));
39 0,
40 0,
41 kBorderColor));
42 size_t offset; 39 size_t offset;
43 base::string16 link_text = 40 base::string16 link_text =
44 l10n_util::GetStringUTF16(IDS_BOOKMARK_SYNC_PROMO_LINK); 41 l10n_util::GetStringUTF16(IDS_BOOKMARK_SYNC_PROMO_LINK);
45 base::string16 promo_text = l10n_util::GetStringFUTF16( 42 base::string16 promo_text = l10n_util::GetStringFUTF16(
46 IDS_BOOKMARK_SYNC_PROMO_MESSAGE, 43 IDS_BOOKMARK_SYNC_PROMO_MESSAGE,
47 link_text, 44 link_text,
48 &offset); 45 &offset);
49 46
50 views::StyledLabel* promo_label = new views::StyledLabel(promo_text, this); 47 views::StyledLabel* promo_label = new views::StyledLabel(promo_text, this);
51 promo_label->SetDisplayedOnBackgroundColor(kBackgroundColor); 48 promo_label->SetDisplayedOnBackgroundColor(kBackgroundColor);
(...skipping 18 matching lines...) Expand all
70 views::kPanelVertMargin, 67 views::kPanelVertMargin,
71 0); 68 0);
72 SetLayoutManager(layout); 69 SetLayoutManager(layout);
73 AddChildView(promo_label); 70 AddChildView(promo_label);
74 } 71 }
75 72
76 void BookmarkSyncPromoView::StyledLabelLinkClicked(const gfx::Range& range, 73 void BookmarkSyncPromoView::StyledLabelLinkClicked(const gfx::Range& range,
77 int event_flags) { 74 int event_flags) {
78 delegate_->OnSignInLinkClicked(); 75 delegate_->OnSignInLinkClicked();
79 } 76 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/avatar_label.cc ('k') | chrome/browser/ui/views/collected_cookies_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698