summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorpodivilov@chromium.org <podivilov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 16:30:05 +0000
committerpodivilov@chromium.org <podivilov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-12 16:30:05 +0000
commit24d27d716c59796e6df6e890109e80bfc09053c8 (patch)
tree7941401363cb24478949bab50a5dcb248fb26e4d /chrome/browser/tab_contents
parent4535dbc797d69d7e9e2a5ecff93ca94c8878a5f0 (diff)
downloadchromium_src-24d27d716c59796e6df6e890109e80bfc09053c8.zip
chromium_src-24d27d716c59796e6df6e890109e80bfc09053c8.tar.gz
chromium_src-24d27d716c59796e6df6e890109e80bfc09053c8.tar.bz2
Inspector settings not updated in profile when inspecting extensions.
BUG=56815 TEST= Review URL: http://codereview.chromium.org/3582021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/background_contents.cc11
-rw-r--r--chrome/browser/tab_contents/background_contents.h4
-rw-r--r--chrome/browser/tab_contents/interstitial_page.cc9
-rw-r--r--chrome/browser/tab_contents/interstitial_page.h4
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc16
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.h5
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc11
7 files changed, 51 insertions, 9 deletions
diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc
index 5121d29..41735d8 100644
--- a/chrome/browser/tab_contents/background_contents.cc
+++ b/chrome/browser/tab_contents/background_contents.cc
@@ -135,6 +135,17 @@ gfx::NativeWindow BackgroundContents::GetMessageBoxRootWindow() {
return NULL;
}
+void BackgroundContents::UpdateInspectorSetting(const std::string& key,
+ const std::string& value) {
+ Profile* profile = render_view_host_->process()->profile();
+ RenderViewHostDelegateHelper::UpdateInspectorSetting(profile, key, value);
+}
+
+void BackgroundContents::ClearInspectorSettings() {
+ Profile* profile = render_view_host_->process()->profile();
+ RenderViewHostDelegateHelper::ClearInspectorSettings(profile);
+}
+
void BackgroundContents::Close(RenderViewHost* render_view_host) {
Profile* profile = render_view_host->process()->profile();
NotificationService::current()->Notify(
diff --git a/chrome/browser/tab_contents/background_contents.h b/chrome/browser/tab_contents/background_contents.h
index 009dd0a..0e48416 100644
--- a/chrome/browser/tab_contents/background_contents.h
+++ b/chrome/browser/tab_contents/background_contents.h
@@ -124,6 +124,10 @@ class BackgroundContents : public RenderViewHostDelegate,
virtual TabContents* AsTabContents() { return NULL; }
virtual ExtensionHost* AsExtensionHost() { return NULL; }
+ virtual void UpdateInspectorSetting(const std::string& key,
+ const std::string& value);
+ virtual void ClearInspectorSettings();
+
protected:
// Exposed for testing.
BackgroundContents();
diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc
index 660dbec..fcf7e76 100644
--- a/chrome/browser/tab_contents/interstitial_page.cc
+++ b/chrome/browser/tab_contents/interstitial_page.cc
@@ -697,3 +697,12 @@ void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply(
int InterstitialPage::GetBrowserWindowID() const {
return tab_->GetBrowserWindowID();
}
+
+void InterstitialPage::UpdateInspectorSetting(const std::string& key,
+ const std::string& value) {
+ RenderViewHostDelegateHelper::UpdateInspectorSetting(tab_->profile(), key, value);
+}
+
+void InterstitialPage::ClearInspectorSettings() {
+ RenderViewHostDelegateHelper::ClearInspectorSettings(tab_->profile());
+}
diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h
index 097fbde..50ede04 100644
--- a/chrome/browser/tab_contents/interstitial_page.h
+++ b/chrome/browser/tab_contents/interstitial_page.h
@@ -111,6 +111,10 @@ class InterstitialPage : public NotificationObserver,
}
bool reload_on_dont_proceed() const { return reload_on_dont_proceed_; }
+ virtual void UpdateInspectorSetting(const std::string& key,
+ const std::string& value);
+ virtual void ClearInspectorSettings();
+
protected:
// NotificationObserver method:
virtual void Observe(NotificationType type,
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index ed52587..5db7189 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -323,3 +323,19 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
return web_prefs;
}
+
+void RenderViewHostDelegateHelper::UpdateInspectorSetting(
+ Profile* profile, const std::string& key, const std::string& value) {
+ DictionaryValue* inspector_settings =
+ profile->GetPrefs()->GetMutableDictionary(
+ prefs::kWebKitInspectorSettings);
+ inspector_settings->SetWithoutPathExpansion(key,
+ Value::CreateStringValue(value));
+}
+
+void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) {
+ DictionaryValue* inspector_settings =
+ profile->GetPrefs()->GetMutableDictionary(
+ prefs::kWebKitInspectorSettings);
+ inspector_settings->Clear();
+}
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.h b/chrome/browser/tab_contents/render_view_host_delegate_helper.h
index a1f2b9b..53cefcb 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.h
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.h
@@ -99,6 +99,11 @@ class RenderViewHostDelegateHelper {
public:
static WebPreferences GetWebkitPrefs(Profile* profile, bool is_dom_ui);
+ static void UpdateInspectorSetting(Profile* profile,
+ const std::string& key,
+ const std::string& value);
+ static void ClearInspectorSettings(Profile* profile);
+
private:
RenderViewHostDelegateHelper();
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index e695633..1f645e5 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2553,18 +2553,11 @@ void TabContents::UpdateThumbnail(const GURL& url,
void TabContents::UpdateInspectorSetting(const std::string& key,
const std::string& value) {
- DictionaryValue* inspector_settings =
- profile()->GetPrefs()->GetMutableDictionary(
- prefs::kWebKitInspectorSettings);
- inspector_settings->SetWithoutPathExpansion(key,
- Value::CreateStringValue(value));
+ RenderViewHostDelegateHelper::UpdateInspectorSetting(profile(), key, value);
}
void TabContents::ClearInspectorSettings() {
- DictionaryValue* inspector_settings =
- profile()->GetPrefs()->GetMutableDictionary(
- prefs::kWebKitInspectorSettings);
- inspector_settings->Clear();
+ RenderViewHostDelegateHelper::ClearInspectorSettings(profile());
}
void TabContents::Close(RenderViewHost* rvh) {