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

Unified Diff: pdf/out_of_process_instance.cc

Issue 871403005: Switch the background color in PDF Viewer when using Material Design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rearrange function declarations 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
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index d6ad71adb6724a9ac7ac9a622c22e612de183aff..cf50ff9a68860aab77375513807cc861a73f8282 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -331,6 +331,7 @@ bool OutOfProcessInstance::Init(uint32_t argc,
const char* stream_url = NULL;
const char* original_url = NULL;
const char* headers = NULL;
+ const char* isMaterial = NULL;
raymes 2015/01/29 05:26:32 is_material
Alexandre Carlton 2015/01/29 06:05:17 Done.
for (uint32_t i = 0; i < argc; ++i) {
if (strcmp(argn[i], "src") == 0)
original_url = argv[i];
@@ -338,8 +339,13 @@ bool OutOfProcessInstance::Init(uint32_t argc,
stream_url = argv[i];
else if (strcmp(argn[i], "headers") == 0)
headers = argv[i];
+ else if (strcmp(argn[i], "is-material") == 0)
+ isMaterial = argv[i];
raymes 2015/01/29 05:26:32 Can we just have a bool here? is_material = true
Alexandre Carlton 2015/01/29 06:05:17 Done.
}
+ if (strcmp(isMaterial, "true") == 0)
raymes 2015/01/29 05:26:32 if (is_material)
Alexandre Carlton 2015/01/29 06:05:17 Done.
+ engine_->SetBackgroundColor(kBackgroundColorMaterial);
+
// 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
// can fix the document loader properly and remove this hack.
@@ -662,7 +668,7 @@ void OutOfProcessInstance::OnPaint(
if (first_paint_) {
first_paint_ = false;
pp::Rect rect = pp::Rect(pp::Point(), image_data_.size());
- FillRect(rect, kBackgroundColor);
+ FillRect(rect, engine_->GetBackgroundColor());
ready->push_back(PaintManager::ReadyRect(rect, image_data_, true));
}
@@ -755,7 +761,7 @@ void OutOfProcessInstance::CalculateBackgroundParts() {
// horizontal centering.
BackgroundPart part = {
pp::Rect(0, 0, left_width, bottom),
- kBackgroundColor
+ engine_->GetBackgroundColor()
};
if (!part.location.IsEmpty())
background_parts_.push_back(part);
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | pdf/pdf_engine.h » ('j') | pdf/pdf_engine.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698