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

Side by Side Diff: ui/message_center/views/message_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/message_view.h" 5 #include "ui/message_center/views/message_view.h"
6 6
7 #include "grit/ui_resources.h" 7 #include "grit/ui_resources.h"
8 #include "grit/ui_strings.h" 8 #include "grit/ui_strings.h"
9 #include "ui/base/accessibility/accessible_view_state.h" 9 #include "ui/base/accessibility/accessible_view_state.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 gfx::Rect(point, gfx::Size()), 152 gfx::Rect(point, gfx::Size()),
153 views::MenuItemView::TOPRIGHT, 153 views::MenuItemView::TOPRIGHT,
154 source_type, 154 source_type,
155 views::MenuRunner::HAS_MNEMONICS)); 155 views::MenuRunner::HAS_MNEMONICS));
156 } 156 }
157 157
158 MessageView::MessageView(const string16& display_source) 158 MessageView::MessageView(const string16& display_source)
159 : context_menu_controller_( 159 : context_menu_controller_(
160 new MessageViewContextMenuController(this, display_source)), 160 new MessageViewContextMenuController(this, display_source)),
161 scroller_(NULL) { 161 scroller_(NULL) {
162 set_focusable(true); 162 SetFocusable(true);
163 set_context_menu_controller(context_menu_controller_.get()); 163 set_context_menu_controller(context_menu_controller_.get());
164 164
165 PaddedButton *close = new PaddedButton(this); 165 PaddedButton *close = new PaddedButton(this);
166 close->SetPadding(-kCloseIconRightPadding, kCloseIconTopPadding); 166 close->SetPadding(-kCloseIconRightPadding, kCloseIconTopPadding);
167 close->SetNormalImage(IDR_NOTIFICATION_CLOSE); 167 close->SetNormalImage(IDR_NOTIFICATION_CLOSE);
168 close->SetHoveredImage(IDR_NOTIFICATION_CLOSE_HOVER); 168 close->SetHoveredImage(IDR_NOTIFICATION_CLOSE_HOVER);
169 close->SetPressedImage(IDR_NOTIFICATION_CLOSE_PRESSED); 169 close->SetPressedImage(IDR_NOTIFICATION_CLOSE_PRESSED);
170 close->set_owned_by_client(); 170 close->set_owned_by_client();
171 close->set_animate_on_state_change(false); 171 close->set_animate_on_state_change(false);
172 close->SetAccessibleName(l10n_util::GetStringUTF16( 172 close->SetAccessibleName(l10n_util::GetStringUTF16(
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 if (sender == close_button()) { 286 if (sender == close_button()) {
287 RemoveNotification(true); // By user. 287 RemoveNotification(true); // By user.
288 } 288 }
289 } 289 }
290 290
291 void MessageView::OnSlideOut() { 291 void MessageView::OnSlideOut() {
292 RemoveNotification(true); // By user. 292 RemoveNotification(true); // By user.
293 } 293 }
294 294
295 } // namespace message_center 295 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698