| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/options/content_page_view.h" | 5 #include "chrome/browser/views/options/content_page_view.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 #include <vsstyle.h> | 9 #include <vsstyle.h> |
| 10 #include <vssym32.h> | 10 #include <vssym32.h> |
| 11 | 11 |
| 12 #include "app/gfx/chrome_canvas.h" | 12 #include "app/gfx/canvas.h" |
| 13 #include "app/l10n_util.h" | 13 #include "app/l10n_util.h" |
| 14 #include "app/resource_bundle.h" | 14 #include "app/resource_bundle.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 17 #include "base/gfx/native_theme.h" | 17 #include "base/gfx/native_theme.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/shell_dialogs.h" | 19 #include "chrome/browser/shell_dialogs.h" |
| 20 #include "chrome/browser/views/options/fonts_languages_window_view.h" | 20 #include "chrome/browser/views/options/fonts_languages_window_view.h" |
| 21 #include "chrome/browser/views/options/options_group_view.h" | 21 #include "chrome/browser/views/options/options_group_view.h" |
| 22 #include "chrome/browser/views/options/passwords_exceptions_window_view.h" | 22 #include "chrome/browser/views/options/passwords_exceptions_window_view.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 47 // FileDisplayArea | 47 // FileDisplayArea |
| 48 | 48 |
| 49 class FileDisplayArea : public views::View { | 49 class FileDisplayArea : public views::View { |
| 50 public: | 50 public: |
| 51 FileDisplayArea(); | 51 FileDisplayArea(); |
| 52 virtual ~FileDisplayArea(); | 52 virtual ~FileDisplayArea(); |
| 53 | 53 |
| 54 void SetFile(const FilePath& file_path); | 54 void SetFile(const FilePath& file_path); |
| 55 | 55 |
| 56 // views::View overrides: | 56 // views::View overrides: |
| 57 virtual void Paint(ChromeCanvas* canvas); | 57 virtual void Paint(gfx::Canvas* canvas); |
| 58 virtual void Layout(); | 58 virtual void Layout(); |
| 59 virtual gfx::Size GetPreferredSize(); | 59 virtual gfx::Size GetPreferredSize(); |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 // views::View overrides: | 62 // views::View overrides: |
| 63 virtual void ViewHierarchyChanged(bool is_add, | 63 virtual void ViewHierarchyChanged(bool is_add, |
| 64 views::View* parent, | 64 views::View* parent, |
| 65 views::View* child); | 65 views::View* child); |
| 66 | 66 |
| 67 private: | 67 private: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 97 // Force file path to have LTR directionality. | 97 // Force file path to have LTR directionality. |
| 98 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { | 98 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { |
| 99 string16 localized_file_path; | 99 string16 localized_file_path; |
| 100 l10n_util::WrapPathWithLTRFormatting(file_path, &localized_file_path); | 100 l10n_util::WrapPathWithLTRFormatting(file_path, &localized_file_path); |
| 101 text_field_->SetText(UTF16ToWide(localized_file_path)); | 101 text_field_->SetText(UTF16ToWide(localized_file_path)); |
| 102 } else { | 102 } else { |
| 103 text_field_->SetText(file_path.ToWStringHack()); | 103 text_field_->SetText(file_path.ToWStringHack()); |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 void FileDisplayArea::Paint(ChromeCanvas* canvas) { | 107 void FileDisplayArea::Paint(gfx::Canvas* canvas) { |
| 108 HDC dc = canvas->beginPlatformPaint(); | 108 HDC dc = canvas->beginPlatformPaint(); |
| 109 RECT rect = { 0, 0, width(), height() }; | 109 RECT rect = { 0, 0, width(), height() }; |
| 110 gfx::NativeTheme::instance()->PaintTextField( | 110 gfx::NativeTheme::instance()->PaintTextField( |
| 111 dc, EP_EDITTEXT, ETS_READONLY, 0, &rect, | 111 dc, EP_EDITTEXT, ETS_READONLY, 0, &rect, |
| 112 skia::SkColorToCOLORREF(text_field_background_color_), true, true); | 112 skia::SkColorToCOLORREF(text_field_background_color_), true, true); |
| 113 canvas->endPlatformPaint(); | 113 canvas->endPlatformPaint(); |
| 114 // Mirror left point for icon_bounds_ to draw icon in RTL locales correctly. | 114 // Mirror left point for icon_bounds_ to draw icon in RTL locales correctly. |
| 115 canvas->DrawBitmapInt(default_folder_icon_, | 115 canvas->DrawBitmapInt(default_folder_icon_, |
| 116 MirroredLeftPointForRect(icon_bounds_), | 116 MirroredLeftPointForRect(icon_bounds_), |
| 117 icon_bounds_.y()); | 117 icon_bounds_.y()); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 541 |
| 542 themes_group_ = new OptionsGroupView( | 542 themes_group_ = new OptionsGroupView( |
| 543 contents, l10n_util::GetString(IDS_THEMES_GROUP_NAME), | 543 contents, l10n_util::GetString(IDS_THEMES_GROUP_NAME), |
| 544 L"", false); | 544 L"", false); |
| 545 } | 545 } |
| 546 | 546 |
| 547 void ContentPageView::UpdateDownloadDirectoryDisplay() { | 547 void ContentPageView::UpdateDownloadDirectoryDisplay() { |
| 548 download_default_download_location_display_->SetFile( | 548 download_default_download_location_display_->SetFile( |
| 549 FilePath::FromWStringHack(default_download_location_.GetValue())); | 549 FilePath::FromWStringHack(default_download_location_.GetValue())); |
| 550 } | 550 } |
| OLD | NEW |