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

Side by Side Diff: ash/system/web_notification/web_notification_tray.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 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
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 "ash/system/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_layout_manager_observer.h" 10 #include "ash/shelf/shelf_layout_manager_observer.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // TODO(mukai): move NINE_PLUS message to ui_strings, it doesn't need to be 260 // TODO(mukai): move NINE_PLUS message to ui_strings, it doesn't need to be
261 // in ash_strings. 261 // in ash_strings.
262 unread_label_->SetText((unread_count > 9) ? 262 unread_label_->SetText((unread_count > 9) ?
263 l10n_util::GetStringUTF16(IDS_ASH_NOTIFICATION_UNREAD_COUNT_NINE_PLUS) : 263 l10n_util::GetStringUTF16(IDS_ASH_NOTIFICATION_UNREAD_COUNT_NINE_PLUS) :
264 base::FormatNumber(unread_count)); 264 base::FormatNumber(unread_count));
265 UpdateIconVisibility(); 265 UpdateIconVisibility();
266 } 266 }
267 267
268 protected: 268 protected:
269 // Overridden from views::ImageButton: 269 // Overridden from views::ImageButton:
270 virtual gfx::Size GetPreferredSize() OVERRIDE { 270 virtual gfx::Size GetPreferredSize() const OVERRIDE {
271 return gfx::Size(kShelfItemHeight, kShelfItemHeight); 271 return gfx::Size(kShelfItemHeight, kShelfItemHeight);
272 } 272 }
273 273
274 virtual int GetHeightForWidth(int width) OVERRIDE { 274 virtual int GetHeightForWidth(int width) OVERRIDE {
275 return GetPreferredSize().height(); 275 return GetPreferredSize().height();
276 } 276 }
277 277
278 private: 278 private:
279 void UpdateIconVisibility() { 279 void UpdateIconVisibility() {
280 unread_label_->SetEnabledColor( 280 unread_label_->SetEnabledColor(
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 611
612 message_center::MessageCenterBubble* 612 message_center::MessageCenterBubble*
613 WebNotificationTray::GetMessageCenterBubbleForTest() { 613 WebNotificationTray::GetMessageCenterBubbleForTest() {
614 if (!message_center_bubble()) 614 if (!message_center_bubble())
615 return NULL; 615 return NULL;
616 return static_cast<message_center::MessageCenterBubble*>( 616 return static_cast<message_center::MessageCenterBubble*>(
617 message_center_bubble()->bubble()); 617 message_center_bubble()->bubble());
618 } 618 }
619 619
620 } // namespace ash 620 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698