diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 02:00:01 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 02:00:01 +0000 |
commit | 3c71576ce539b9c8e2480e1a257dca945391c40a (patch) | |
tree | 2e2581cebbf92059d6ccc6dc51b83746c934976a /chrome/browser/ui/browser_commands.cc | |
parent | c5072ad5f9c23f8509db857e974f936bafe0a693 (diff) | |
download | chromium_src-3c71576ce539b9c8e2480e1a257dca945391c40a.zip chromium_src-3c71576ce539b9c8e2480e1a257dca945391c40a.tar.gz chromium_src-3c71576ce539b9c8e2480e1a257dca945391c40a.tar.bz2 |
Hide knowledge of webkit::ppapi::PluginDelegate from chrome. This is part of moving ppapi implementation from webkit/plugins/ppapi to content/renderer.
Chrome used four methods on that interface for PDFs.
-DidStartLoading/DidStopLoading: I just exposed these methods from RenderViewImpl on the RenderView interface
-SetContentRestriction: I moved this functionality completely into chrome. This allows us to get rid of all the content restrictions related methods in the content API, and to move content_restriction.h out to chrome.
-SaveURLAs: exposed the internal SaveURL method on WebContents
BUG=263054
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/19800005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_commands.cc')
-rw-r--r-- | chrome/browser/ui/browser_commands.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 22f6e1c..c083fba 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc @@ -50,12 +50,14 @@ #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" #include "chrome/browser/ui/omnibox/location_bar.h" #include "chrome/browser/ui/status_bubble.h" +#include "chrome/browser/ui/tab_contents/core_tab_helper.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" #include "chrome/browser/upgrade_detector.h" #include "chrome/browser/web_applications/web_app.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" +#include "chrome/common/content_restriction.h" #include "chrome/common/pref_names.h" #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "content/public/browser/devtools_agent_host.h" @@ -67,7 +69,6 @@ #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" -#include "content/public/common/content_restriction.h" #include "content/public/common/renderer_preferences.h" #include "content/public/common/url_constants.h" #include "content/public/common/url_utils.h" @@ -242,16 +243,18 @@ int GetContentRestrictions(const Browser* browser) { int content_restrictions = 0; WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); if (current_tab) { - content_restrictions = current_tab->GetContentRestrictions(); + CoreTabHelper* core_tab_helper = + CoreTabHelper::FromWebContents(current_tab); + content_restrictions = core_tab_helper->content_restrictions(); NavigationEntry* active_entry = current_tab->GetController().GetActiveEntry(); // See comment in UpdateCommandsForTabState about why we call url(). if (!content::IsSavableURL( active_entry ? active_entry->GetURL() : GURL()) || current_tab->ShowingInterstitialPage()) - content_restrictions |= content::CONTENT_RESTRICTION_SAVE; + content_restrictions |= CONTENT_RESTRICTION_SAVE; if (current_tab->ShowingInterstitialPage()) - content_restrictions |= content::CONTENT_RESTRICTION_PRINT; + content_restrictions |= CONTENT_RESTRICTION_PRINT; } return content_restrictions; } @@ -694,7 +697,7 @@ bool CanSavePage(const Browser* browser) { return false; } return !browser->is_devtools() && - !(GetContentRestrictions(browser) & content::CONTENT_RESTRICTION_SAVE); + !(GetContentRestrictions(browser) & CONTENT_RESTRICTION_SAVE); } void ShowFindBar(Browser* browser) { @@ -726,7 +729,7 @@ bool CanPrint(const Browser* browser) { // Do not print when a constrained window is showing. It's confusing. return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && !(IsShowingWebContentsModalDialog(browser) || - GetContentRestrictions(browser) & content::CONTENT_RESTRICTION_PRINT); + GetContentRestrictions(browser) & CONTENT_RESTRICTION_PRINT); } void AdvancedPrint(Browser* browser) { |