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

Side by Side Diff: ui/message_center/views/notification_view.cc

Issue 108063004: Give up focus if the focused view becomes unfocusable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Extracted to common code into FocusManager class Created 7 years 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 "ui/message_center/views/notification_view.h" 5 #include "ui/message_center/views/notification_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 DISALLOW_COPY_AND_ASSIGN(NotificationButton); 337 DISALLOW_COPY_AND_ASSIGN(NotificationButton);
338 }; 338 };
339 339
340 NotificationButton::NotificationButton(views::ButtonListener* listener) 340 NotificationButton::NotificationButton(views::ButtonListener* listener)
341 : views::CustomButton(listener), 341 : views::CustomButton(listener),
342 icon_(NULL), 342 icon_(NULL),
343 title_(NULL), 343 title_(NULL),
344 focus_painter_(views::Painter::CreateSolidFocusPainter( 344 focus_painter_(views::Painter::CreateSolidFocusPainter(
345 message_center::kFocusBorderColor, 345 message_center::kFocusBorderColor,
346 gfx::Insets(1, 2, 2, 2))) { 346 gfx::Insets(1, 2, 2, 2))) {
347 set_focusable(true); 347 SetFocusable(true);
348 set_request_focus_on_press(false); 348 set_request_focus_on_press(false);
349 set_notify_enter_exit_on_child(true); 349 set_notify_enter_exit_on_child(true);
350 SetLayoutManager( 350 SetLayoutManager(
351 new views::BoxLayout(views::BoxLayout::kHorizontal, 351 new views::BoxLayout(views::BoxLayout::kHorizontal,
352 message_center::kButtonHorizontalPadding, 352 message_center::kButtonHorizontalPadding,
353 kButtonVecticalPadding, 353 kButtonVecticalPadding,
354 message_center::kButtonIconToTitlePadding)); 354 message_center::kButtonIconToTitlePadding));
355 } 355 }
356 356
357 NotificationButton::~NotificationButton() { 357 NotificationButton::~NotificationButton() {
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 return message_view_ ? 851 return message_view_ ?
852 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; 852 message_view_->GetLinesForWidthAndLimit(width, limit) : 0;
853 } 853 }
854 854
855 int NotificationView::GetMessageHeight(int width, int limit) { 855 int NotificationView::GetMessageHeight(int width, int limit) {
856 return message_view_ ? 856 return message_view_ ?
857 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; 857 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0;
858 } 858 }
859 859
860 } // namespace message_center 860 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698