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

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

Issue 1841653003: Drop |languages| from {Format,Elide}Url* and IDNToUnicode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo in elide_url.cc Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/public/platform/Platform.h ('k') | 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/message_center/views/notification_view.h" 5 #include "ui/message_center/views/notification_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 522 }
523 523
524 message_view_->SetVisible(!notification.items().size()); 524 message_view_->SetVisible(!notification.items().size());
525 } 525 }
526 526
527 base::string16 NotificationView::FormatContextMessage( 527 base::string16 NotificationView::FormatContextMessage(
528 const Notification& notification) const { 528 const Notification& notification) const {
529 if (notification.UseOriginAsContextMessage()) { 529 if (notification.UseOriginAsContextMessage()) {
530 const GURL url = notification.origin_url(); 530 const GURL url = notification.origin_url();
531 DCHECK(url.is_valid()); 531 DCHECK(url.is_valid());
532 // TODO(palmer): Find a way to get the Profile's real languages. 532 return gfx::ElideText(
533 // crbug.com/496965. 533 url_formatter::FormatUrlForSecurityDisplayOmitScheme(url),
534 return gfx::ElideText(url_formatter::FormatUrlForSecurityDisplayOmitScheme( 534 views::Label().font_list(), kContextMessageViewWidth,
535 url, std::string()), 535 gfx::ELIDE_HEAD);
536 views::Label().font_list(), kContextMessageViewWidth,
537 gfx::ELIDE_HEAD);
538 } 536 }
539 537
540 return gfx::TruncateString(notification.context_message(), 538 return gfx::TruncateString(notification.context_message(),
541 kContextMessageCharacterLimit, gfx::WORD_BREAK); 539 kContextMessageCharacterLimit, gfx::WORD_BREAK);
542 } 540 }
543 541
544 void NotificationView::CreateOrUpdateContextMessageView( 542 void NotificationView::CreateOrUpdateContextMessageView(
545 const Notification& notification) { 543 const Notification& notification) {
546 if (notification.context_message().empty() && 544 if (notification.context_message().empty() &&
547 !notification.UseOriginAsContextMessage()) { 545 !notification.UseOriginAsContextMessage()) {
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 void NotificationView::RequestFocusOnCloseButton() { 838 void NotificationView::RequestFocusOnCloseButton() {
841 if (close_button_) 839 if (close_button_)
842 close_button_->RequestFocus(); 840 close_button_->RequestFocus();
843 } 841 }
844 842
845 bool NotificationView::IsPinned() { 843 bool NotificationView::IsPinned() {
846 return !close_button_; 844 return !close_button_;
847 } 845 }
848 846
849 } // namespace message_center 847 } // namespace message_center
OLDNEW
« no previous file with comments | « third_party/WebKit/public/platform/Platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698