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

Side by Side Diff: chrome/browser/ui/views/options/advanced_contents_view.cc

Issue 6246036: FilePath: Remove most of ToWStringHack, adding a LossyDisplayName() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bug link Created 9 years, 10 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/process_singleton_win.cc ('k') | chrome/browser/ui/views/shell_dialogs_win.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/options/advanced_contents_view.h" 5 #include "chrome/browser/ui/views/options/advanced_contents_view.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <cryptuiapi.h> 9 #include <cryptuiapi.h>
10 #pragma comment(lib, "cryptui.lib") 10 #pragma comment(lib, "cryptui.lib")
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 FileDisplayArea::~FileDisplayArea() { 129 FileDisplayArea::~FileDisplayArea() {
130 } 130 }
131 131
132 void FileDisplayArea::SetFile(const FilePath& file_path) { 132 void FileDisplayArea::SetFile(const FilePath& file_path) {
133 // Force file path to have LTR directionality. 133 // Force file path to have LTR directionality.
134 if (base::i18n::IsRTL()) { 134 if (base::i18n::IsRTL()) {
135 string16 localized_file_path; 135 string16 localized_file_path;
136 base::i18n::WrapPathWithLTRFormatting(file_path, &localized_file_path); 136 base::i18n::WrapPathWithLTRFormatting(file_path, &localized_file_path);
137 text_field_->SetText(UTF16ToWide(localized_file_path)); 137 text_field_->SetText(UTF16ToWide(localized_file_path));
138 } else { 138 } else {
139 text_field_->SetText(file_path.ToWStringHack()); 139 text_field_->SetText(file_path.LossyDisplayName());
140 } 140 }
141 } 141 }
142 142
143 void FileDisplayArea::Paint(gfx::Canvas* canvas) { 143 void FileDisplayArea::Paint(gfx::Canvas* canvas) {
144 HDC dc = canvas->BeginPlatformPaint(); 144 HDC dc = canvas->BeginPlatformPaint();
145 RECT rect = { 0, 0, width(), height() }; 145 RECT rect = { 0, 0, width(), height() };
146 gfx::NativeTheme::instance()->PaintTextField( 146 gfx::NativeTheme::instance()->PaintTextField(
147 dc, EP_EDITTEXT, ETS_READONLY, 0, &rect, 147 dc, EP_EDITTEXT, ETS_READONLY, 0, &rect,
148 skia::SkColorToCOLORREF(text_field_background_color_), true, true); 148 skia::SkColorToCOLORREF(text_field_background_color_), true, true);
149 canvas->EndPlatformPaint(); 149 canvas->EndPlatformPaint();
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 // AdvancedScrollViewContainer, views::View overrides: 1647 // AdvancedScrollViewContainer, views::View overrides:
1648 1648
1649 void AdvancedScrollViewContainer::Layout() { 1649 void AdvancedScrollViewContainer::Layout() {
1650 gfx::Rect lb = GetLocalBounds(false); 1650 gfx::Rect lb = GetLocalBounds(false);
1651 1651
1652 gfx::Size border = gfx::NativeTheme::instance()->GetThemeBorderSize( 1652 gfx::Size border = gfx::NativeTheme::instance()->GetThemeBorderSize(
1653 gfx::NativeTheme::LIST); 1653 gfx::NativeTheme::LIST);
1654 lb.Inset(border.width(), border.height()); 1654 lb.Inset(border.width(), border.height());
1655 scroll_view_->SetBounds(lb); 1655 scroll_view_->SetBounds(lb);
1656 } 1656 }
OLDNEW
« no previous file with comments | « chrome/browser/process_singleton_win.cc ('k') | chrome/browser/ui/views/shell_dialogs_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698