| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |