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_resources.h" | |
11 #include "content/app/resources/grit/content_resources.h" | 10 #include "content/app/resources/grit/content_resources.h" |
12 #include "content/app/strings/grit/content_strings.h" | 11 #include "content/app/strings/grit/content_strings.h" |
13 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
14 #include "content/public/common/user_agent.h" | 13 #include "content/public/common/user_agent.h" |
15 #include "content/shell/common/shell_switches.h" | 14 #include "content/shell/common/shell_switches.h" |
16 #include "grit/shell_resources.h" | 15 #include "grit/shell_resources.h" |
17 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
18 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
19 | 18 |
20 namespace content { | 19 namespace content { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 57 } |
59 return l10n_util::GetStringUTF16(message_id); | 58 return l10n_util::GetStringUTF16(message_id); |
60 } | 59 } |
61 | 60 |
62 base::StringPiece ShellContentClient::GetDataResource( | 61 base::StringPiece ShellContentClient::GetDataResource( |
63 int resource_id, | 62 int resource_id, |
64 ui::ScaleFactor scale_factor) const { | 63 ui::ScaleFactor scale_factor) const { |
65 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 64 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
66 switches::kRunLayoutTest)) { | 65 switches::kRunLayoutTest)) { |
67 switch (resource_id) { | 66 switch (resource_id) { |
68 case IDR_BROKENIMAGE: | 67 case IDR2_BROKENIMAGE: |
69 #if defined(OS_MACOSX) | 68 #if defined(OS_MACOSX) |
70 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_PNG; | 69 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_PNG; |
71 #else | 70 #else |
72 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_GIF; | 71 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_GIF; |
73 #endif | 72 #endif |
74 break; | 73 break; |
75 | 74 |
76 case IDR_TEXTAREA_RESIZER: | 75 case IDR2_TEXTAREA_RESIZER: |
77 resource_id = IDR_CONTENT_SHELL_TEXT_AREA_RESIZE_CORNER_PNG; | 76 resource_id = IDR_CONTENT_SHELL_TEXT_AREA_RESIZE_CORNER_PNG; |
78 break; | 77 break; |
79 } | 78 } |
80 } | 79 } |
81 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | 80 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( |
82 resource_id, scale_factor); | 81 resource_id, scale_factor); |
83 } | 82 } |
84 | 83 |
85 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( | 84 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( |
86 int resource_id) const { | 85 int resource_id) const { |
87 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | 86 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); |
88 } | 87 } |
89 | 88 |
90 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { | 89 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { |
91 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 90 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
92 } | 91 } |
93 | 92 |
94 } // namespace content | 93 } // namespace content |
OLD | NEW |