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

Side by Side Diff: ui/views/examples/button_example.cc

Issue 2483753003: views examples: remove obsolete CTA button example (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/examples/button_example.h" 5 #include "ui/views/examples/button_example.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/image/image.h" 9 #include "ui/gfx/image/image.h"
10 #include "ui/resources/grit/ui_resources.h" 10 #include "ui/resources/grit/ui_resources.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 md_button_ = 62 md_button_ =
63 MdTextButton::Create(this, base::ASCIIToUTF16("Material design")); 63 MdTextButton::Create(this, base::ASCIIToUTF16("Material design"));
64 container->AddChildView(md_button_); 64 container->AddChildView(md_button_);
65 65
66 md_default_button_ = 66 md_default_button_ =
67 MdTextButton::Create(this, base::ASCIIToUTF16("Default")); 67 MdTextButton::Create(this, base::ASCIIToUTF16("Default"));
68 md_default_button_->SetIsDefault(true); 68 md_default_button_->SetIsDefault(true);
69 container->AddChildView(md_default_button_); 69 container->AddChildView(md_default_button_);
70 70
71 md_prominent_button_ =
sky 2016/11/07 17:03:31 Remove field too.
72 MdTextButton::Create(this, base::ASCIIToUTF16("Call to action"));
73 md_prominent_button_->SetProminent(true);
74 container->AddChildView(md_prominent_button_);
75
76 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 71 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
77 image_button_ = new ImageButton(this); 72 image_button_ = new ImageButton(this);
78 image_button_->SetFocusForPlatform(); 73 image_button_->SetFocusForPlatform();
79 image_button_->set_request_focus_on_press(true); 74 image_button_->set_request_focus_on_press(true);
80 image_button_->SetImage(ImageButton::STATE_NORMAL, 75 image_button_->SetImage(ImageButton::STATE_NORMAL,
81 rb.GetImageNamed(IDR_CLOSE).ToImageSkia()); 76 rb.GetImageNamed(IDR_CLOSE).ToImageSkia());
82 image_button_->SetImage(ImageButton::STATE_HOVERED, 77 image_button_->SetImage(ImageButton::STATE_HOVERED,
83 rb.GetImageNamed(IDR_CLOSE_H).ToImageSkia()); 78 rb.GetImageNamed(IDR_CLOSE_H).ToImageSkia());
84 image_button_->SetImage(ImageButton::STATE_PRESSED, 79 image_button_->SetImage(ImageButton::STATE_PRESSED,
85 rb.GetImageNamed(IDR_CLOSE_P).ToImageSkia()); 80 rb.GetImageNamed(IDR_CLOSE_P).ToImageSkia());
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } else if (sender == md_button_ || sender == md_default_button_ || 129 } else if (sender == md_button_ || sender == md_default_button_ ||
135 sender == md_prominent_button_) { 130 sender == md_prominent_button_) {
136 static_cast<CustomButton*>(sender)->StartThrobbing(5); 131 static_cast<CustomButton*>(sender)->StartThrobbing(5);
137 } else { 132 } else {
138 PrintStatus("Image Button Pressed! count: %d", ++count_); 133 PrintStatus("Image Button Pressed! count: %d", ++count_);
139 } 134 }
140 } 135 }
141 136
142 } // namespace examples 137 } // namespace examples
143 } // namespace views 138 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698