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

Unified Diff: pdf/out_of_process_instance.cc

Issue 874663006: Make the PDF viewer background color a property of the instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « pdf/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index 0ccfa36b5db64281b17a92f000f21c6d206e77f7..169a4403498a21b2a2eb9dac16f5c88ff5e022f8 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -271,7 +271,8 @@ OutOfProcessInstance::OutOfProcessInstance(PP_Instance instance)
recently_sent_find_update_(false),
received_viewport_message_(false),
did_call_start_loading_(false),
- stop_scrolling_(false) {
+ stop_scrolling_(false),
+ background_color_(kBackgroundColor) {
loader_factory_.Initialize(this);
timer_factory_.Initialize(this);
form_factory_.Initialize(this);
@@ -348,10 +349,9 @@ bool OutOfProcessInstance::Init(uint32_t argc,
}
if (is_material)
- engine_->SetBackgroundColor(kBackgroundColorMaterial);
+ background_color_ = kBackgroundColorMaterial;
else
- engine_->SetBackgroundColor(kBackgroundColor);
-
+ background_color_ = kBackgroundColor;
// TODO(raymes): This is a hack to ensure that if no headers are passed in
// then we get the right MIME type. When the in process plugin is removed we
@@ -675,7 +675,7 @@ void OutOfProcessInstance::OnPaint(
if (first_paint_) {
first_paint_ = false;
pp::Rect rect = pp::Rect(pp::Point(), image_data_.size());
- FillRect(rect, engine_->GetBackgroundColor());
+ FillRect(rect, background_color_);
ready->push_back(PaintManager::ReadyRect(rect, image_data_, true));
}
@@ -768,7 +768,7 @@ void OutOfProcessInstance::CalculateBackgroundParts() {
// horizontal centering.
BackgroundPart part = {
pp::Rect(0, 0, left_width, bottom),
- engine_->GetBackgroundColor()
+ background_color_
};
if (!part.location.IsEmpty())
background_parts_.push_back(part);
@@ -1347,6 +1347,10 @@ bool OutOfProcessInstance::IsPrintPreview() {
return IsPrintPreviewUrl(url_);
}
+uint32 OutOfProcessInstance::GetBackgroundColor() {
+ return background_color_;
+}
+
void OutOfProcessInstance::ProcessPreviewPageInfo(const std::string& url,
int dst_page_index) {
if (!IsPrintPreview())
« no previous file with comments | « pdf/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698