OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/shell/common/shell_content_client.h" | 5 #include "content/shell/common/shell_content_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "blink/public/resources/grit/blink_image_resources.h" | 10 #include "blink/public/resources/grit/blink_image_resources.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 return l10n_util::GetStringUTF16(message_id); | 59 return l10n_util::GetStringUTF16(message_id); |
60 } | 60 } |
61 | 61 |
62 base::StringPiece ShellContentClient::GetDataResource( | 62 base::StringPiece ShellContentClient::GetDataResource( |
63 int resource_id, | 63 int resource_id, |
64 ui::ScaleFactor scale_factor) const { | 64 ui::ScaleFactor scale_factor) const { |
65 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 65 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
66 switches::kRunLayoutTest)) { | 66 switches::kRunLayoutTest)) { |
67 switch (resource_id) { | 67 switch (resource_id) { |
68 case IDR2_BROKENIMAGE: | 68 case IDR_BROKENIMAGE: |
69 #if defined(OS_MACOSX) | 69 #if defined(OS_MACOSX) |
70 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_PNG; | 70 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_PNG; |
71 #else | 71 #else |
72 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_GIF; | 72 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_GIF; |
73 #endif | 73 #endif |
74 break; | 74 break; |
75 | 75 |
76 case IDR2_TEXTAREA_RESIZER: | 76 case IDR_TEXTAREA_RESIZER: |
77 resource_id = IDR_CONTENT_SHELL_TEXT_AREA_RESIZE_CORNER_PNG; | 77 resource_id = IDR_CONTENT_SHELL_TEXT_AREA_RESIZE_CORNER_PNG; |
78 break; | 78 break; |
79 } | 79 } |
80 } | 80 } |
81 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | 81 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( |
82 resource_id, scale_factor); | 82 resource_id, scale_factor); |
83 } | 83 } |
84 | 84 |
85 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( | 85 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( |
86 int resource_id) const { | 86 int resource_id) const { |
87 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | 87 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); |
88 } | 88 } |
89 | 89 |
90 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { | 90 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { |
91 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 91 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
92 } | 92 } |
93 | 93 |
94 } // namespace content | 94 } // namespace content |
OLD | NEW |