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 "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 26 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
27 if (command_line->HasSwitch(switches::kUseMobileUserAgent)) | 27 if (command_line->HasSwitch(switches::kUseMobileUserAgent)) |
28 product += " Mobile"; | 28 product += " Mobile"; |
29 return webkit_glue::BuildUserAgentFromProduct(product); | 29 return webkit_glue::BuildUserAgentFromProduct(product); |
30 } | 30 } |
31 | 31 |
32 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { | 32 base::string16 ShellContentClient::GetLocalizedString(int message_id) const { |
33 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { | 33 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
34 switch (message_id) { | 34 switch (message_id) { |
35 case IDS_FORM_OTHER_DATE_LABEL: | 35 case IDS_FORM_OTHER_DATE_LABEL: |
36 return ASCIIToUTF16("<<OtherDateLabel>>"); | 36 return base::ASCIIToUTF16("<<OtherDateLabel>>"); |
37 case IDS_FORM_OTHER_MONTH_LABEL: | 37 case IDS_FORM_OTHER_MONTH_LABEL: |
38 return ASCIIToUTF16("<<OtherMonthLabel>>"); | 38 return base::ASCIIToUTF16("<<OtherMonthLabel>>"); |
39 case IDS_FORM_OTHER_TIME_LABEL: | 39 case IDS_FORM_OTHER_TIME_LABEL: |
40 return ASCIIToUTF16("<<OtherTimeLabel>>"); | 40 return base::ASCIIToUTF16("<<OtherTimeLabel>>"); |
41 case IDS_FORM_OTHER_WEEK_LABEL: | 41 case IDS_FORM_OTHER_WEEK_LABEL: |
42 return ASCIIToUTF16("<<OtherWeekLabel>>"); | 42 return base::ASCIIToUTF16("<<OtherWeekLabel>>"); |
43 case IDS_FORM_CALENDAR_CLEAR: | 43 case IDS_FORM_CALENDAR_CLEAR: |
44 return ASCIIToUTF16("<<CalendarClear>>"); | 44 return base::ASCIIToUTF16("<<CalendarClear>>"); |
45 case IDS_FORM_CALENDAR_TODAY: | 45 case IDS_FORM_CALENDAR_TODAY: |
46 return ASCIIToUTF16("<<CalendarToday>>"); | 46 return base::ASCIIToUTF16("<<CalendarToday>>"); |
47 case IDS_FORM_THIS_MONTH_LABEL: | 47 case IDS_FORM_THIS_MONTH_LABEL: |
48 return ASCIIToUTF16("<<ThisMonthLabel>>"); | 48 return base::ASCIIToUTF16("<<ThisMonthLabel>>"); |
49 case IDS_FORM_THIS_WEEK_LABEL: | 49 case IDS_FORM_THIS_WEEK_LABEL: |
50 return ASCIIToUTF16("<<ThisWeekLabel>>"); | 50 return base::ASCIIToUTF16("<<ThisWeekLabel>>"); |
51 } | 51 } |
52 } | 52 } |
53 return l10n_util::GetStringUTF16(message_id); | 53 return l10n_util::GetStringUTF16(message_id); |
54 } | 54 } |
55 | 55 |
56 base::StringPiece ShellContentClient::GetDataResource( | 56 base::StringPiece ShellContentClient::GetDataResource( |
57 int resource_id, | 57 int resource_id, |
58 ui::ScaleFactor scale_factor) const { | 58 ui::ScaleFactor scale_factor) const { |
59 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { | 59 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
60 switch (resource_id) { | 60 switch (resource_id) { |
(...skipping 17 matching lines...) Expand all Loading... |
78 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( | 78 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( |
79 int resource_id) const { | 79 int resource_id) const { |
80 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | 80 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); |
81 } | 81 } |
82 | 82 |
83 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { | 83 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { |
84 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 84 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
85 } | 85 } |
86 | 86 |
87 } // namespace content | 87 } // namespace content |
OLD | NEW |