OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |