Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: content/shell/common/shell_content_client.cc

Issue 1033733004: Part 3 of 4: Modify blink users so they use the image resources in blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix 100/200 percent packs. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/shell/BUILD.gn ('k') | extensions/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
10 #include "content/app/resources/grit/content_resources.h" 11 #include "content/app/resources/grit/content_resources.h"
11 #include "content/app/strings/grit/content_strings.h" 12 #include "content/app/strings/grit/content_strings.h"
12 #include "content/public/common/content_switches.h" 13 #include "content/public/common/content_switches.h"
13 #include "content/public/common/user_agent.h" 14 #include "content/public/common/user_agent.h"
14 #include "content/shell/common/shell_switches.h" 15 #include "content/shell/common/shell_switches.h"
15 #include "grit/shell_resources.h" 16 #include "grit/shell_resources.h"
16 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
17 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
18 19
19 namespace content { 20 namespace content {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 58 }
58 return l10n_util::GetStringUTF16(message_id); 59 return l10n_util::GetStringUTF16(message_id);
59 } 60 }
60 61
61 base::StringPiece ShellContentClient::GetDataResource( 62 base::StringPiece ShellContentClient::GetDataResource(
62 int resource_id, 63 int resource_id,
63 ui::ScaleFactor scale_factor) const { 64 ui::ScaleFactor scale_factor) const {
64 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 65 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
65 switches::kRunLayoutTest)) { 66 switches::kRunLayoutTest)) {
66 switch (resource_id) { 67 switch (resource_id) {
67 case IDR2_BROKENIMAGE: 68 case IDR_BROKENIMAGE:
68 #if defined(OS_MACOSX) 69 #if defined(OS_MACOSX)
69 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_PNG; 70 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_PNG;
70 #else 71 #else
71 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_GIF; 72 resource_id = IDR_CONTENT_SHELL_MISSING_IMAGE_GIF;
72 #endif 73 #endif
73 break; 74 break;
74 75
75 case IDR2_TEXTAREA_RESIZER: 76 case IDR_TEXTAREA_RESIZER:
76 resource_id = IDR_CONTENT_SHELL_TEXT_AREA_RESIZE_CORNER_PNG; 77 resource_id = IDR_CONTENT_SHELL_TEXT_AREA_RESIZE_CORNER_PNG;
77 break; 78 break;
78 } 79 }
79 } 80 }
80 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( 81 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
81 resource_id, scale_factor); 82 resource_id, scale_factor);
82 } 83 }
83 84
84 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes( 85 base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes(
85 int resource_id) const { 86 int resource_id) const {
86 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); 87 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
87 } 88 }
88 89
89 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const { 90 gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const {
90 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); 91 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
91 } 92 }
92 93
93 } // namespace content 94 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/BUILD.gn ('k') | extensions/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698