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

Side by Side Diff: chrome/browser/ui/views/autofill/autocheckout_bubble_views.cc

Issue 12330002: Add views::Button style enum for LabelButton [native] styling, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. Created 7 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
« no previous file with comments | « ash/system/user/tray_user.cc ('k') | ui/app_list/views/signin_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/autofill/autocheckout_bubble_views.h" 5 #include "chrome/browser/ui/views/autofill/autocheckout_bubble_views.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/ui/autofill/autocheckout_bubble.h" 9 #include "chrome/browser/ui/autofill/autocheckout_bubble.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 0); 82 0);
83 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing); 83 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing);
84 cs->AddColumn(views::GridLayout::CENTER, 84 cs->AddColumn(views::GridLayout::CENTER,
85 views::GridLayout::CENTER, 85 views::GridLayout::CENTER,
86 0, 86 0,
87 views::GridLayout::USE_PREF, 87 views::GridLayout::USE_PREF,
88 0, 88 0,
89 0); 89 0);
90 layout->StartRow(0, 2); 90 layout->StartRow(0, 2);
91 ok_button_ = new views::LabelButton(this, ASCIIToUTF16(kAcceptText)); 91 ok_button_ = new views::LabelButton(this, ASCIIToUTF16(kAcceptText));
92 ok_button_->SetNativeTheme(true); 92 ok_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON);
93 layout->AddView(ok_button_); 93 layout->AddView(ok_button_);
94 cancel_button_ = new views::LabelButton(this, ASCIIToUTF16(kCancelText)); 94 cancel_button_ = new views::LabelButton(this, ASCIIToUTF16(kCancelText));
95 cancel_button_->SetNativeTheme(true); 95 cancel_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON);
96 layout->AddView(cancel_button_); 96 layout->AddView(cancel_button_);
97 } 97 }
98 98
99 gfx::Rect AutocheckoutBubbleViews::GetAnchorRect() { 99 gfx::Rect AutocheckoutBubbleViews::GetAnchorRect() {
100 return gfx::ToNearestRect(bounding_box_); 100 return gfx::ToNearestRect(bounding_box_);
101 } 101 }
102 102
103 void AutocheckoutBubbleViews::ButtonPressed(views::Button* sender, 103 void AutocheckoutBubbleViews::ButtonPressed(views::Button* sender,
104 const ui::Event& event) { 104 const ui::Event& event) {
105 if (sender == ok_button_) { 105 if (sender == ok_button_) {
(...skipping 12 matching lines...) Expand all
118 const base::Closure& callback) { 118 const base::Closure& callback) {
119 AutocheckoutBubbleViews* delegate = new AutocheckoutBubbleViews(anchor, 119 AutocheckoutBubbleViews* delegate = new AutocheckoutBubbleViews(anchor,
120 callback); 120 callback);
121 delegate->set_parent_window(native_view); 121 delegate->set_parent_window(native_view);
122 views::BubbleDelegateView::CreateBubble(delegate); 122 views::BubbleDelegateView::CreateBubble(delegate);
123 delegate->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); 123 delegate->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
124 delegate->StartFade(true); 124 delegate->StartFade(true);
125 } 125 }
126 126
127 } // namespace autofill 127 } // namespace autofill
OLDNEW
« no previous file with comments | « ash/system/user/tray_user.cc ('k') | ui/app_list/views/signin_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698