summaryrefslogtreecommitdiffstats
path: root/pdf
diff options
context:
space:
mode:
authorraymes <raymes@chromium.org>2015-09-17 00:15:50 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-17 07:16:47 +0000
commitafc5c4888e220c21cf3edebe8f615bb66e33c7b8 (patch)
tree181d6d1aceb4ec70a247ca53482cd2493ce15244 /pdf
parent5e669f04cbfb8655af0afe5854def2263018e1be (diff)
downloadchromium_src-afc5c4888e220c21cf3edebe8f615bb66e33c7b8.zip
chromium_src-afc5c4888e220c21cf3edebe8f615bb66e33c7b8.tar.gz
chromium_src-afc5c4888e220c21cf3edebe8f615bb66e33c7b8.tar.bz2
Change the print preview UI to use the material design style buttons for zoom
This changes print preview to use the material buttons for zooming. It also reconciles the codepaths so that print preview uses the same codepath as the material design viewer which will allow us to remove a bunch of code once the material UI is switched on by default. BUG= Review URL: https://codereview.chromium.org/1332273003 Cr-Commit-Position: refs/heads/master@{#349371}
Diffstat (limited to 'pdf')
-rw-r--r--pdf/out_of_process_instance.cc22
1 files changed, 8 insertions, 14 deletions
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index 6ab52be..0c0124e 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -53,10 +53,6 @@ const char kAccessibleNumberOfPages[] = "numberOfPages";
const char kAccessibleLoaded[] = "loaded";
const char kAccessibleCopyable[] = "copyable";
-// PDF background colors.
-const uint32 kBackgroundColor = 0xFFCCCCCC;
-const uint32 kBackgroundColorMaterial = 0xFF525659;
-
// Constants used in handling postMessage() messages.
const char kType[] = "type";
// Viewport message arguments. (Page -> Plugin).
@@ -281,7 +277,7 @@ OutOfProcessInstance::OutOfProcessInstance(PP_Instance instance)
received_viewport_message_(false),
did_call_start_loading_(false),
stop_scrolling_(false),
- background_color_(kBackgroundColor),
+ background_color_(0),
top_toolbar_height_(0) {
loader_factory_.Initialize(this);
timer_factory_.Initialize(this);
@@ -350,24 +346,22 @@ bool OutOfProcessInstance::Init(uint32_t argc,
const char* stream_url = nullptr;
const char* original_url = nullptr;
const char* headers = nullptr;
- bool is_material = false;
for (uint32_t i = 0; i < argc; ++i) {
+ bool success = true;
if (strcmp(argn[i], "src") == 0)
original_url = argv[i];
else if (strcmp(argn[i], "stream-url") == 0)
stream_url = argv[i];
else if (strcmp(argn[i], "headers") == 0)
headers = argv[i];
- else if (strcmp(argn[i], "is-material") == 0)
- is_material = true;
+ else if (strcmp(argn[i], "background-color") == 0)
+ success = base::HexStringToUInt(argv[i], &background_color_);
else if (strcmp(argn[i], "top-toolbar-height") == 0)
- base::StringToInt(argv[i], &top_toolbar_height_);
- }
+ success = base::StringToInt(argv[i], &top_toolbar_height_);
- if (is_material)
- background_color_ = kBackgroundColorMaterial;
- else
- background_color_ = kBackgroundColor;
+ if (!success)
+ return false;
+ }
if (!original_url)
return false;