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

Side by Side Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 7008005: base/i18n: Pass |str| as const reference in BreakIterator::Init(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const reference Created 9 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
« no previous file with comments | « chrome/browser/history/query_parser.cc ('k') | ui/base/text/text_elider.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/download/download_item_view.h" 5 #include "chrome/browser/ui/views/download/download_item_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 1036
1037 // Make the label big so that GetPreferredSize() is not constrained by the 1037 // Make the label big so that GetPreferredSize() is not constrained by the
1038 // current width. 1038 // current width.
1039 dangerous_download_label_->SetBounds(0, 0, 1000, 1000); 1039 dangerous_download_label_->SetBounds(0, 0, 1000, 1000);
1040 1040
1041 gfx::Size size; 1041 gfx::Size size;
1042 int min_width = -1; 1042 int min_width = -1;
1043 // Using BREAK_WORD can work in most cases, but it can also break 1043 // Using BREAK_WORD can work in most cases, but it can also break
1044 // lines where it should not. Using BREAK_LINE is safer although 1044 // lines where it should not. Using BREAK_LINE is safer although
1045 // slower for Chinese/Japanese. This is not perf-critical at all, though. 1045 // slower for Chinese/Japanese. This is not perf-critical at all, though.
1046 base::i18n::BreakIterator iter(&text, base::i18n::BreakIterator::BREAK_LINE); 1046 base::i18n::BreakIterator iter(text, base::i18n::BreakIterator::BREAK_LINE);
1047 bool status = iter.Init(); 1047 bool status = iter.Init();
1048 DCHECK(status); 1048 DCHECK(status);
1049 1049
1050 string16 current_text = text; 1050 string16 current_text = text;
1051 string16 prev_text = text; 1051 string16 prev_text = text;
1052 while (iter.Advance()) { 1052 while (iter.Advance()) {
1053 size_t pos = iter.pos(); 1053 size_t pos = iter.pos();
1054 if (pos >= text.length()) 1054 if (pos >= text.length())
1055 break; 1055 break;
1056 // This can be a low surrogate codepoint, but u_isUWhiteSpace will 1056 // This can be a low surrogate codepoint, but u_isUWhiteSpace will
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 // If the name has changed, notify assistive technology that the name 1112 // If the name has changed, notify assistive technology that the name
1113 // has changed so they can announce it immediately. 1113 // has changed so they can announce it immediately.
1114 if (new_name != accessible_name_) { 1114 if (new_name != accessible_name_) {
1115 accessible_name_ = new_name; 1115 accessible_name_ = new_name;
1116 if (GetWidget()) { 1116 if (GetWidget()) {
1117 GetWidget()->NotifyAccessibilityEvent( 1117 GetWidget()->NotifyAccessibilityEvent(
1118 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true); 1118 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true);
1119 } 1119 }
1120 } 1120 }
1121 } 1121 }
OLDNEW
« no previous file with comments | « chrome/browser/history/query_parser.cc ('k') | ui/base/text/text_elider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698