| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/views_content_client/views_content_main_delegate.h" | 5 #include "ui/views_content_client/views_content_main_delegate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 base::FilePath ui_test_pak_path; | 63 base::FilePath ui_test_pak_path; |
| 64 CHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 64 CHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 65 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 65 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 66 | 66 |
| 67 // Load content resources to provide, e.g., sandbox configuration data on Mac. | 67 // Load content resources to provide, e.g., sandbox configuration data on Mac. |
| 68 base::FilePath content_resources_pak_path; | 68 base::FilePath content_resources_pak_path; |
| 69 PathService::Get(base::DIR_MODULE, &content_resources_pak_path); | 69 PathService::Get(base::DIR_MODULE, &content_resources_pak_path); |
| 70 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 70 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 71 content_resources_pak_path.AppendASCII("content_resources.pak"), | 71 content_resources_pak_path.AppendASCII("content_resources.pak"), |
| 72 ui::SCALE_FACTOR_100P); | 72 ui::SCALE_FACTOR_100P); |
| 73 |
| 74 if (ui::ResourceBundle::IsScaleFactorSupported(ui::SCALE_FACTOR_200P)) { |
| 75 base::FilePath ui_test_resources_200 = ui_test_pak_path.DirName().Append( |
| 76 FILE_PATH_LITERAL("ui_test_200_percent.pak")); |
| 77 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 78 ui_test_resources_200, ui::SCALE_FACTOR_200P); |
| 79 } |
| 73 } | 80 } |
| 74 | 81 |
| 75 content::ContentBrowserClient* | 82 content::ContentBrowserClient* |
| 76 ViewsContentMainDelegate::CreateContentBrowserClient() { | 83 ViewsContentMainDelegate::CreateContentBrowserClient() { |
| 77 browser_client_.reset(new ViewsContentBrowserClient(views_content_client_)); | 84 browser_client_.reset(new ViewsContentBrowserClient(views_content_client_)); |
| 78 return browser_client_.get(); | 85 return browser_client_.get(); |
| 79 } | 86 } |
| 80 | 87 |
| 81 } // namespace ui | 88 } // namespace ui |
| OLD | NEW |