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

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

Issue 1843063002: Don't show scheme in permission prompts if it is HTTPS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 | « components/url_formatter/elide_url_unittest.cc ('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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 message_view_->SetVisible(!notification.items().size()); 526 message_view_->SetVisible(!notification.items().size());
527 } 527 }
528 528
529 base::string16 NotificationView::FormatContextMessage( 529 base::string16 NotificationView::FormatContextMessage(
530 const Notification& notification) const { 530 const Notification& notification) const {
531 if (notification.UseOriginAsContextMessage()) { 531 if (notification.UseOriginAsContextMessage()) {
532 const GURL url = notification.origin_url(); 532 const GURL url = notification.origin_url();
533 DCHECK(url.is_valid()); 533 DCHECK(url.is_valid());
534 return gfx::ElideText( 534 return gfx::ElideText(
535 url_formatter::FormatUrlForSecurityDisplayOmitScheme(url), 535 url_formatter::FormatUrlForSecurityDisplay(
536 views::Label().font_list(), kContextMessageViewWidth, 536 url, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS),
537 gfx::ELIDE_HEAD); 537 views::Label().font_list(), kContextMessageViewWidth, gfx::ELIDE_HEAD);
538 } 538 }
539 539
540 return gfx::TruncateString(notification.context_message(), 540 return gfx::TruncateString(notification.context_message(),
541 kContextMessageCharacterLimit, gfx::WORD_BREAK); 541 kContextMessageCharacterLimit, gfx::WORD_BREAK);
542 } 542 }
543 543
544 void NotificationView::CreateOrUpdateContextMessageView( 544 void NotificationView::CreateOrUpdateContextMessageView(
545 const Notification& notification) { 545 const Notification& notification) {
546 if (notification.context_message().empty() && 546 if (notification.context_message().empty() &&
547 !notification.UseOriginAsContextMessage()) { 547 !notification.UseOriginAsContextMessage()) {
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 void NotificationView::RequestFocusOnCloseButton() { 840 void NotificationView::RequestFocusOnCloseButton() {
841 if (close_button_) 841 if (close_button_)
842 close_button_->RequestFocus(); 842 close_button_->RequestFocus();
843 } 843 }
844 844
845 bool NotificationView::IsPinned() { 845 bool NotificationView::IsPinned() {
846 return !close_button_; 846 return !close_button_;
847 } 847 }
848 848
849 } // namespace message_center 849 } // namespace message_center
OLDNEW
« no previous file with comments | « components/url_formatter/elide_url_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698