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

Side by Side Diff: chrome/browser/ui/pdf/pdf_unsupported_feature.cc

Issue 541103002: Introduce ChromeZoomLevelPref, make zoom level prefs independent of profile prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert to using only profile prefs. Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/pdf/pdf_unsupported_feature.h" 5 #include "chrome/browser/ui/pdf/pdf_unsupported_feature.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/lifetime/application_lifetime.h" 10 #include "chrome/browser/lifetime/application_lifetime.h"
11 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 11 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
12 #include "chrome/browser/plugins/plugin_metadata.h" 12 #include "chrome/browser/plugins/plugin_metadata.h"
13 #include "chrome/browser/plugins/plugin_prefs.h" 13 #include "chrome/browser/plugins/plugin_prefs.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/renderer_preferences_util.h" 15 #include "chrome/browser/renderer_preferences_util.h"
16 #include "chrome/browser/tab_contents/tab_util.h" 16 #include "chrome/browser/tab_contents/tab_util.h"
17 #include "chrome/browser/ui/zoom/zoom_controller.h"
17 #include "chrome/common/chrome_content_client.h" 18 #include "chrome/common/chrome_content_client.h"
18 #include "chrome/grit/generated_resources.h" 19 #include "chrome/grit/generated_resources.h"
19 #include "components/pdf/browser/open_pdf_in_reader_prompt_client.h" 20 #include "components/pdf/browser/open_pdf_in_reader_prompt_client.h"
20 #include "components/pdf/browser/pdf_web_contents_helper.h" 21 #include "components/pdf/browser/pdf_web_contents_helper.h"
21 #include "content/public/browser/interstitial_page.h" 22 #include "content/public/browser/interstitial_page.h"
22 #include "content/public/browser/interstitial_page_delegate.h" 23 #include "content/public/browser/interstitial_page_delegate.h"
23 #include "content/public/browser/navigation_details.h" 24 #include "content/public/browser/navigation_details.h"
24 #include "content/public/browser/navigation_entry.h" 25 #include "content/public/browser/navigation_entry.h"
25 #include "content/public/browser/page_navigator.h" 26 #include "content/public/browser/page_navigator.h"
26 #include "content/public/browser/render_frame_host.h" 27 #include "content/public/browser/render_frame_host.h"
27 #include "content/public/browser/render_process_host.h" 28 #include "content/public/browser/render_process_host.h"
28 #include "content/public/browser/render_view_host.h" 29 #include "content/public/browser/render_view_host.h"
29 #include "content/public/browser/user_metrics.h" 30 #include "content/public/browser/user_metrics.h"
30 #include "content/public/browser/web_contents.h" 31 #include "content/public/browser/web_contents.h"
32 #include "content/public/common/renderer_preferences.h"
31 #include "grit/browser_resources.h" 33 #include "grit/browser_resources.h"
32 #include "ui/base/l10n/l10n_util.h" 34 #include "ui/base/l10n/l10n_util.h"
33 #include "ui/base/resource/resource_bundle.h" 35 #include "ui/base/resource/resource_bundle.h"
34 #include "ui/base/webui/jstemplate_builder.h" 36 #include "ui/base/webui/jstemplate_builder.h"
35 37
36 #if defined(OS_WIN) 38 #if defined(OS_WIN)
37 #include "base/win/metro.h" 39 #include "base/win/metro.h"
38 #include "chrome/browser/ui/pdf/adobe_reader_info_win.h" 40 #include "chrome/browser/ui/pdf/adobe_reader_info_win.h"
39 #endif 41 #endif
40 42
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 NOTREACHED(); 214 NOTREACHED();
213 } 215 }
214 interstitial_page_->Proceed(); 216 interstitial_page_->Proceed();
215 } 217 }
216 218
217 virtual void OverrideRendererPrefs( 219 virtual void OverrideRendererPrefs(
218 content::RendererPreferences* prefs) OVERRIDE { 220 content::RendererPreferences* prefs) OVERRIDE {
219 Profile* profile = 221 Profile* profile =
220 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); 222 Profile::FromBrowserContext(web_contents_->GetBrowserContext());
221 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); 223 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile);
224 prefs->default_zoom_level =
225 ZoomController::FromWebContents(web_contents_)->GetDefaultZoomLevel();
222 } 226 }
223 227
224 private: 228 private:
225 WebContents* web_contents_; 229 WebContents* web_contents_;
226 WebPluginInfo reader_webplugininfo_; 230 WebPluginInfo reader_webplugininfo_;
227 InterstitialPage* interstitial_page_; // Owns us. 231 InterstitialPage* interstitial_page_; // Owns us.
228 232
229 DISALLOW_COPY_AND_ASSIGN(PDFUnsupportedFeatureInterstitial); 233 DISALLOW_COPY_AND_ASSIGN(PDFUnsupportedFeatureInterstitial);
230 }; 234 };
231 235
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 MaybeShowOpenPDFInReaderPrompt(web_contents, reader_info); 362 MaybeShowOpenPDFInReaderPrompt(web_contents, reader_info);
359 return; 363 return;
360 } 364 }
361 GetAdobeReaderPluginInfoAsync( 365 GetAdobeReaderPluginInfoAsync(
362 profile, 366 profile,
363 base::Bind(&GotPluginsCallback, 367 base::Bind(&GotPluginsCallback,
364 web_contents->GetRenderProcessHost()->GetID(), 368 web_contents->GetRenderProcessHost()->GetID(),
365 web_contents->GetRenderViewHost()->GetRoutingID())); 369 web_contents->GetRenderViewHost()->GetRoutingID()));
366 #endif // defined(OS_WIN) 370 #endif // defined(OS_WIN)
367 } 371 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698