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

Side by Side Diff: ui/base/models/simple_menu_model.cc

Issue 460143003: Mac: silently fall back to normal separator drawing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | 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/base/models/simple_menu_model.h" 5 #include "ui/base/models/simple_menu_model.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/gfx/image/image.h" 10 #include "ui/gfx/image/image.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 if (separator_type == NORMAL_SEPARATOR) { 124 if (separator_type == NORMAL_SEPARATOR) {
125 return; 125 return;
126 } 126 }
127 DCHECK_EQ(SPACING_SEPARATOR, separator_type); 127 DCHECK_EQ(SPACING_SEPARATOR, separator_type);
128 } else if (items_.back().type == TYPE_SEPARATOR) { 128 } else if (items_.back().type == TYPE_SEPARATOR) {
129 DCHECK_EQ(NORMAL_SEPARATOR, separator_type); 129 DCHECK_EQ(NORMAL_SEPARATOR, separator_type);
130 DCHECK_EQ(NORMAL_SEPARATOR, items_.back().separator_type); 130 DCHECK_EQ(NORMAL_SEPARATOR, items_.back().separator_type);
131 return; 131 return;
132 } 132 }
133 #if !defined(USE_AURA) 133 #if !defined(USE_AURA)
134 if (separator_type != NORMAL_SEPARATOR) 134 if (separator_type == SPACING_SEPARATOR)
135 NOTIMPLEMENTED(); 135 NOTIMPLEMENTED();
136 #endif 136 #endif
137 Item item = { kSeparatorId, base::string16(), base::string16(), 137 Item item = { kSeparatorId, base::string16(), base::string16(),
138 base::string16(), gfx::Image(), TYPE_SEPARATOR, -1, NULL, NULL, 138 base::string16(), gfx::Image(), TYPE_SEPARATOR, -1, NULL, NULL,
139 separator_type }; 139 separator_type };
140 AppendItem(item); 140 AppendItem(item);
141 } 141 }
142 142
143 void SimpleMenuModel::RemoveTrailingSeparators() { 143 void SimpleMenuModel::RemoveTrailingSeparators() {
144 while (!items_.empty() && items_.back().type == TYPE_SEPARATOR) 144 while (!items_.empty() && items_.back().type == TYPE_SEPARATOR)
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 #ifndef NDEBUG 452 #ifndef NDEBUG
453 if (item.type == TYPE_SEPARATOR) { 453 if (item.type == TYPE_SEPARATOR) {
454 DCHECK_EQ(item.command_id, kSeparatorId); 454 DCHECK_EQ(item.command_id, kSeparatorId);
455 } else { 455 } else {
456 DCHECK_GE(item.command_id, 0); 456 DCHECK_GE(item.command_id, 0);
457 } 457 }
458 #endif // NDEBUG 458 #endif // NDEBUG
459 } 459 }
460 460
461 } // namespace ui 461 } // namespace ui
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