| Index: chrome/browser/ui/tab_contents/core_tab_helper.cc
|
| ===================================================================
|
| --- chrome/browser/ui/tab_contents/core_tab_helper.cc (revision 212906)
|
| +++ chrome/browser/ui/tab_contents/core_tab_helper.cc (working copy)
|
| @@ -7,6 +7,9 @@
|
| #include "base/command_line.h"
|
| #include "base/metrics/histogram.h"
|
| #include "chrome/browser/renderer_host/web_cache_manager.h"
|
| +#include "chrome/browser/ui/browser.h"
|
| +#include "chrome/browser/ui/browser_command_controller.h"
|
| +#include "chrome/browser/ui/browser_finder.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "content/public/browser/render_process_host.h"
|
| #include "content/public/browser/render_view_host.h"
|
| @@ -21,7 +24,8 @@
|
|
|
| CoreTabHelper::CoreTabHelper(WebContents* web_contents)
|
| : content::WebContentsObserver(web_contents),
|
| - delegate_(NULL) {
|
| + delegate_(NULL),
|
| + content_restrictions_(0) {
|
| }
|
|
|
| CoreTabHelper::~CoreTabHelper() {
|
| @@ -110,9 +114,24 @@
|
| unload_detached_start_time_ = base::TimeTicks::Now();
|
| }
|
|
|
| +void CoreTabHelper::UpdateContentRestrictions(int content_restrictions) {
|
| + content_restrictions_ = content_restrictions;
|
| +#if !defined(OS_ANDROID)
|
| + Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
|
| + if (!browser)
|
| + return;
|
| +
|
| + browser->command_controller()->ContentRestrictionsChanged();
|
| +#endif
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // WebContentsObserver overrides
|
|
|
| +void CoreTabHelper::DidStartLoading(content::RenderViewHost* render_view_host) {
|
| + UpdateContentRestrictions(0);
|
| +}
|
| +
|
| void CoreTabHelper::WasShown() {
|
| WebCacheManager::GetInstance()->ObserveActivity(
|
| web_contents()->GetRenderProcessHost()->GetID());
|
|
|