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

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

Issue 10383034: views/examples: Clean up cpplint warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « no previous file | ui/views/examples/content_client/examples_browser_main_parts.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 (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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/image/image.h" 10 #include "ui/gfx/image/image.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 if (event.IsAltDown()) { 62 if (event.IsAltDown()) {
63 text_button_->SetMultiLine(!text_button_->multi_line()); 63 text_button_->SetMultiLine(!text_button_->multi_line());
64 if (text_button_->multi_line()) { 64 if (text_button_->multi_line()) {
65 text_button_->SetText(ASCIIToUTF16("Multi-line text\n") + 65 text_button_->SetText(ASCIIToUTF16("Multi-line text\n") +
66 ASCIIToUTF16("is here to stay all the way!\n") + 66 ASCIIToUTF16("is here to stay all the way!\n") +
67 ASCIIToUTF16("123")); 67 ASCIIToUTF16("123"));
68 } else { 68 } else {
69 text_button_->SetText(ASCIIToUTF16("Button")); 69 text_button_->SetText(ASCIIToUTF16("Button"));
70 } 70 }
71 } else { 71 } else {
72 switch(text_button_->icon_placement()) { 72 switch (text_button_->icon_placement()) {
73 case TextButton::ICON_ON_LEFT: 73 case TextButton::ICON_ON_LEFT:
74 text_button_->set_icon_placement(TextButton::ICON_ON_RIGHT); 74 text_button_->set_icon_placement(TextButton::ICON_ON_RIGHT);
75 break; 75 break;
76 case TextButton::ICON_ON_RIGHT: 76 case TextButton::ICON_ON_RIGHT:
77 text_button_->set_icon_placement(TextButton::ICON_ON_LEFT); 77 text_button_->set_icon_placement(TextButton::ICON_ON_LEFT);
78 break; 78 break;
79 } 79 }
80 } 80 }
81 } else if (event.IsAltDown()) { 81 } else if (event.IsAltDown()) {
82 if (text_button_->HasIcon()) 82 if (text_button_->HasIcon())
83 text_button_->SetIcon(SkBitmap()); 83 text_button_->SetIcon(SkBitmap());
84 else 84 else
85 text_button_->SetIcon(*icon_); 85 text_button_->SetIcon(*icon_);
86 } else { 86 } else {
87 switch(alignment_) { 87 switch (alignment_) {
88 case TextButton::ALIGN_LEFT: 88 case TextButton::ALIGN_LEFT:
89 alignment_ = TextButton::ALIGN_CENTER; 89 alignment_ = TextButton::ALIGN_CENTER;
90 break; 90 break;
91 case TextButton::ALIGN_CENTER: 91 case TextButton::ALIGN_CENTER:
92 alignment_ = TextButton::ALIGN_RIGHT; 92 alignment_ = TextButton::ALIGN_RIGHT;
93 break; 93 break;
94 case TextButton::ALIGN_RIGHT: 94 case TextButton::ALIGN_RIGHT:
95 alignment_ = TextButton::ALIGN_LEFT; 95 alignment_ = TextButton::ALIGN_LEFT;
96 break; 96 break;
97 } 97 }
(...skipping 19 matching lines...) Expand all
117 text_button_->set_border(new TextButtonBorder()); 117 text_button_->set_border(new TextButtonBorder());
118 } 118 }
119 } else if (event.IsAltDown()) { 119 } else if (event.IsAltDown()) {
120 text_button_->SetIsDefault(!text_button_->is_default()); 120 text_button_->SetIsDefault(!text_button_->is_default());
121 } 121 }
122 example_view()->GetLayoutManager()->Layout(example_view()); 122 example_view()->GetLayoutManager()->Layout(example_view());
123 } 123 }
124 124
125 } // namespace examples 125 } // namespace examples
126 } // namespace views 126 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/examples/content_client/examples_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698