blob: a5d48b468d4a91ae670931868d01babaec9aba0d [file] [log] [blame]
karandeepbe60fc3c2016-01-21 23:22:421// Copyright 2016 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_RESOURCE_DELEGATE_MAC_H_
6#define CHROME_BROWSER_RESOURCE_DELEGATE_MAC_H_
7
8#include "base/macros.h"
9#include "ui/base/resource/resource_bundle.h"
10
11// A resource bundle delegate for Mac. Primary purpose is to intercept certain
12// resource ids, and to provide assets from system APIs for them at runtime.
13class MacResourceDelegate : public ui::ResourceBundle::Delegate {
14 public:
15 MacResourceDelegate();
16 ~MacResourceDelegate() override;
17
18 // ui:ResourceBundle::Delegate implementation:
19 base::FilePath GetPathForResourcePack(const base::FilePath& pack_path,
20 ui::ScaleFactor scale_factor) override;
21 base::FilePath GetPathForLocalePack(const base::FilePath& pack_path,
22 const std::string& locale) override;
23 gfx::Image GetImageNamed(int resource_id) override;
24 gfx::Image GetNativeImageNamed(int resource_id) override;
25 base::RefCountedStaticMemory* LoadDataResourceBytes(
26 int resource_id,
27 ui::ScaleFactor scale_factor) override;
28 bool GetRawDataResource(int resource_id,
29 ui::ScaleFactor scale_factor,
30 base::StringPiece* value) override;
31 bool GetLocalizedString(int message_id, base::string16* value) override;
karandeepbe60fc3c2016-01-21 23:22:4232
33 private:
34 DISALLOW_COPY_AND_ASSIGN(MacResourceDelegate);
35};
36
37#endif // CHROME_BROWSER_RESOURCE_DELEGATE_MAC_H_