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

Unified Diff: ui/base/resource/data_pack.h

Issue 854713003: More old files deletion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tryjobs? Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/resource/OWNERS ('k') | ui/base/resource/data_pack.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/data_pack.h
diff --git a/ui/base/resource/data_pack.h b/ui/base/resource/data_pack.h
deleted file mode 100644
index 928c855afa639041d81c75c70ad601aafd7c91f2..0000000000000000000000000000000000000000
--- a/ui/base/resource/data_pack.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// DataPack represents a read-only view onto an on-disk file that contains
-// (key, value) pairs of data. It's used to store static resources like
-// translation strings and images.
-
-#ifndef UI_BASE_RESOURCE_DATA_PACK_H_
-#define UI_BASE_RESOURCE_DATA_PACK_H_
-
-#include <map>
-
-#include "base/basictypes.h"
-#include "base/files/file.h"
-#include "base/files/memory_mapped_file.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/strings/string_piece.h"
-#include "ui/base/layout.h"
-#include "ui/base/resource/resource_handle.h"
-#include "ui/base/ui_base_export.h"
-
-namespace base {
-class FilePath;
-class RefCountedStaticMemory;
-}
-
-namespace ui {
-
-class UI_BASE_EXPORT DataPack : public ResourceHandle {
- public:
- DataPack(ui::ScaleFactor scale_factor);
- ~DataPack() override;
-
- // Load a pack file from |path|, returning false on error.
- bool LoadFromPath(const base::FilePath& path);
-
- // Loads a pack file from |file|, returning false on error.
- bool LoadFromFile(base::File file);
-
- // Loads a pack file from |region| of |file|, returning false on error.
- bool LoadFromFileRegion(base::File file,
- const base::MemoryMappedFile::Region& region);
-
- // Writes a pack file containing |resources| to |path|. If there are any
- // text resources to be written, their encoding must already agree to the
- // |textEncodingType| specified. If no text resources are present, please
- // indicate BINARY.
- static bool WritePack(const base::FilePath& path,
- const std::map<uint16, base::StringPiece>& resources,
- TextEncodingType textEncodingType);
-
- // ResourceHandle implementation:
- bool HasResource(uint16 resource_id) const override;
- bool GetStringPiece(uint16 resource_id,
- base::StringPiece* data) const override;
- base::RefCountedStaticMemory* GetStaticMemory(
- uint16 resource_id) const override;
- TextEncodingType GetTextEncodingType() const override;
- ui::ScaleFactor GetScaleFactor() const override;
-
- private:
- // Does the actual loading of a pack file. Called by Load and LoadFromFile.
- bool LoadImpl();
-
- // The memory-mapped data.
- scoped_ptr<base::MemoryMappedFile> mmap_;
-
- // Number of resources in the data.
- size_t resource_count_;
-
- // Type of encoding for text resources.
- TextEncodingType text_encoding_type_;
-
- // The scale of the image in this resource pack relative to images in the 1x
- // resource pak.
- ui::ScaleFactor scale_factor_;
-
- DISALLOW_COPY_AND_ASSIGN(DataPack);
-};
-
-} // namespace ui
-
-#endif // UI_BASE_RESOURCE_DATA_PACK_H_
« no previous file with comments | « ui/base/resource/OWNERS ('k') | ui/base/resource/data_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698