summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-23 00:58:23 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-23 00:58:23 +0000
commit45644f6cc27340a43cddec94054c0c90ef65b7c9 (patch)
tree18aa26a314a5ff51bc82c40cb709427ebe8a754a /chrome/browser
parentffe38f8add90e8c29055cd2aed4937ed5c45273a (diff)
downloadchromium_src-45644f6cc27340a43cddec94054c0c90ef65b7c9.zip
chromium_src-45644f6cc27340a43cddec94054c0c90ef65b7c9.tar.gz
chromium_src-45644f6cc27340a43cddec94054c0c90ef65b7c9.tar.bz2
Move PropertyBag to base. Originally this was in chrome\common because only chrome used it. Now that chrome and content use it, and that we want to only expose interface through the content API, this belongs in base.
BUG=98716 Review URL: http://codereview.chromium.org/8652002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111266 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/extensions/extension_omnibox_api.cc4
-rw-r--r--chrome/browser/extensions/extension_service.cc3
-rw-r--r--chrome/browser/extensions/extension_service.h6
-rw-r--r--chrome/browser/tabs/tab_strip_model_unittest.cc6
-rw-r--r--chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm5
-rw-r--r--chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc5
-rw-r--r--chrome/browser/ui/tab_contents/tab_contents_wrapper.cc5
-rw-r--r--chrome/browser/ui/tab_contents/tab_contents_wrapper.h2
-rw-r--r--chrome/browser/ui/views/omnibox/omnibox_view_views.cc5
-rw-r--r--chrome/browser/ui/views/omnibox/omnibox_view_win.cc4
-rw-r--r--chrome/browser/ui/webui/constrained_html_ui.cc5
-rw-r--r--chrome/browser/ui/webui/constrained_html_ui.h7
-rw-r--r--chrome/browser/ui/webui/html_dialog_ui.cc6
-rw-r--r--chrome/browser/ui/webui/html_dialog_ui.h12
14 files changed, 43 insertions, 32 deletions
diff --git a/chrome/browser/extensions/extension_omnibox_api.cc b/chrome/browser/extensions/extension_omnibox_api.cc
index 300333e..20a1a8d 100644
--- a/chrome/browser/extensions/extension_omnibox_api.cc
+++ b/chrome/browser/extensions/extension_omnibox_api.cc
@@ -40,11 +40,11 @@ const char kDescriptionStylesType[] = "type";
const char kDescriptionStylesOffset[] = "offset";
const char kDescriptionStylesLength[] = "length";
-static base::LazyInstance<PropertyAccessor<ExtensionOmniboxSuggestion> >
+static base::LazyInstance<base::PropertyAccessor<ExtensionOmniboxSuggestion> >
g_extension_omnibox_suggestion_property_accessor =
LAZY_INSTANCE_INITIALIZER;
-PropertyAccessor<ExtensionOmniboxSuggestion>& GetPropertyAccessor() {
+base::PropertyAccessor<ExtensionOmniboxSuggestion>& GetPropertyAccessor() {
return g_extension_omnibox_suggestion_property_accessor.Get();
}
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index d51c3f6..009dedb 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -2438,7 +2438,8 @@ void ExtensionService::SetHasUsedWebRequest(const Extension* extension,
extension_runtime_data_[extension->id()].has_used_webrequest = value;
}
-PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) {
+base::PropertyBag* ExtensionService::GetPropertyBag(
+ const Extension* extension) {
return &extension_runtime_data_[extension->id()].property_bag;
}
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 4c1c58e..677fb19 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -19,6 +19,7 @@
#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "base/property_bag.h"
#include "base/time.h"
#include "base/tuple.h"
#include "chrome/browser/extensions/apps_promo.h"
@@ -40,7 +41,6 @@
#include "chrome/browser/sync/api/syncable_service.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
-#include "content/common/property_bag.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -243,7 +243,7 @@ class ExtensionService
void SetHasUsedWebRequest(const Extension* extension, bool value);
// Getter for the extension's runtime data PropertyBag.
- PropertyBag* GetPropertyBag(const Extension* extension);
+ base::PropertyBag* GetPropertyBag(const Extension* extension);
// Initialize and start all installed extensions.
void Init();
@@ -575,7 +575,7 @@ class ExtensionService
bool has_used_webrequest;
// Generic bag of runtime data that users can associate with extensions.
- PropertyBag property_bag;
+ base::PropertyBag property_bag;
ExtensionRuntimeData();
~ExtensionRuntimeData();
diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc
index 9267058..1e50b32 100644
--- a/chrome/browser/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/tabs/tab_strip_model_unittest.cc
@@ -11,6 +11,7 @@
#include "base/file_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
+#include "base/property_bag.h"
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
#include "base/string_split.h"
@@ -31,7 +32,6 @@
#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/common/property_bag.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
@@ -256,8 +256,8 @@ class TabStripModelTest : public ChromeRenderViewHostTestHarness {
}
private:
- PropertyAccessor<int>* GetIDAccessor() {
- static PropertyAccessor<int> accessor;
+ base::PropertyAccessor<int>* GetIDAccessor() {
+ static base::PropertyAccessor<int> accessor;
return &accessor;
}
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
index 230fedd..38aa4b3 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -103,8 +103,9 @@ struct OmniboxViewMacState {
// state in a TabContents. When constructed |accessor| generates a
// globally-unique id used to index into the per-tab PropertyBag used
// to store the state data.
-PropertyAccessor<OmniboxViewMacState>* GetStateAccessor() {
- CR_DEFINE_STATIC_LOCAL(PropertyAccessor<OmniboxViewMacState>, accessor, ());
+base::PropertyAccessor<OmniboxViewMacState>* GetStateAccessor() {
+ CR_DEFINE_STATIC_LOCAL(
+ base::PropertyAccessor<OmniboxViewMacState>, accessor, ());
return &accessor;
}
diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
index 6d03644..a33f839 100644
--- a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
+++ b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
@@ -105,8 +105,9 @@ struct AutocompleteEditState {
// Returns a lazily initialized property bag accessor for saving our state in a
// TabContents.
-PropertyAccessor<AutocompleteEditState>* GetStateAccessor() {
- CR_DEFINE_STATIC_LOCAL(PropertyAccessor<AutocompleteEditState>, state, ());
+base::PropertyAccessor<AutocompleteEditState>* GetStateAccessor() {
+ CR_DEFINE_STATIC_LOCAL(
+ base::PropertyAccessor<AutocompleteEditState>, state, ());
return &state;
}
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
index a8b57fe..0413250 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc
@@ -65,7 +65,7 @@
namespace {
-static base::LazyInstance<PropertyAccessor<TabContentsWrapper*> >
+static base::LazyInstance<base::PropertyAccessor<TabContentsWrapper*> >
g_tab_contents_wrapper_property_accessor = LAZY_INSTANCE_INITIALIZER;
// The list of prefs we want to observe.
@@ -362,7 +362,8 @@ TabContentsWrapper::~TabContentsWrapper() {
infobar_tab_helper_.reset();
}
-PropertyAccessor<TabContentsWrapper*>* TabContentsWrapper::property_accessor() {
+base::PropertyAccessor<TabContentsWrapper*>*
+ TabContentsWrapper::property_accessor() {
return g_tab_contents_wrapper_property_accessor.Pointer();
}
diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h
index 91b8a57..0844291 100644
--- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h
+++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h
@@ -90,7 +90,7 @@ class TabContentsWrapper : public TabContentsObserver,
// Used to retrieve this object from |tab_contents_|, which is placed in
// its property bag to avoid adding additional interfaces.
- static PropertyAccessor<TabContentsWrapper*>* property_accessor();
+ static base::PropertyAccessor<TabContentsWrapper*>* property_accessor();
static void RegisterUserPrefs(PrefService* prefs);
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 8defd93..0b958c0 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -108,8 +108,9 @@ struct AutocompleteEditState {
// Returns a lazily initialized property bag accessor for saving our state in a
// TabContents.
-PropertyAccessor<AutocompleteEditState>* GetStateAccessor() {
- CR_DEFINE_STATIC_LOCAL(PropertyAccessor<AutocompleteEditState>, state, ());
+base::PropertyAccessor<AutocompleteEditState>* GetStateAccessor() {
+ CR_DEFINE_STATIC_LOCAL(
+ base::PropertyAccessor<AutocompleteEditState>, state, ());
return &state;
}
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index 9c1723d..cce7d39 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -366,8 +366,8 @@ BOOL WINAPI EndPaintIntercept(HWND hWnd, const PAINTSTRUCT* lpPaint) {
// Returns a lazily initialized property bag accessor for saving our state in a
// TabContents.
-PropertyAccessor<AutocompleteEditState>* GetStateAccessor() {
- static PropertyAccessor<AutocompleteEditState> state;
+base::PropertyAccessor<AutocompleteEditState>* GetStateAccessor() {
+ static base::PropertyAccessor<AutocompleteEditState> state;
return &state;
}
diff --git a/chrome/browser/ui/webui/constrained_html_ui.cc b/chrome/browser/ui/webui/constrained_html_ui.cc
index c0a5b84..6549242 100644
--- a/chrome/browser/ui/webui/constrained_html_ui.cc
+++ b/chrome/browser/ui/webui/constrained_html_ui.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/lazy_instance.h"
+#include "base/property_bag.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/html_dialog_ui.h"
#include "chrome/common/chrome_notification_types.h"
@@ -17,7 +18,7 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_service.h"
-static base::LazyInstance<PropertyAccessor<ConstrainedHtmlUIDelegate*> >
+static base::LazyInstance<base::PropertyAccessor<ConstrainedHtmlUIDelegate*> >
g_constrained_html_ui_property_accessor = LAZY_INSTANCE_INITIALIZER;
ConstrainedHtmlUI::ConstrainedHtmlUI(TabContents* contents)
@@ -73,7 +74,7 @@ ConstrainedHtmlUIDelegate* ConstrainedHtmlUI::GetConstrainedDelegate() {
}
// static
-PropertyAccessor<ConstrainedHtmlUIDelegate*>&
+base::PropertyAccessor<ConstrainedHtmlUIDelegate*>&
ConstrainedHtmlUI::GetPropertyAccessor() {
return g_constrained_html_ui_property_accessor.Get();
}
diff --git a/chrome/browser/ui/webui/constrained_html_ui.h b/chrome/browser/ui/webui/constrained_html_ui.h
index 03d2022..77c2b3b 100644
--- a/chrome/browser/ui/webui/constrained_html_ui.h
+++ b/chrome/browser/ui/webui/constrained_html_ui.h
@@ -7,7 +7,6 @@
#pragma once
#include "chrome/browser/ui/webui/chrome_web_ui.h"
-#include "content/common/property_bag.h"
class ConstrainedWindow;
class HtmlDialogUIDelegate;
@@ -16,6 +15,10 @@ class RenderViewHost;
class TabContents;
class TabContentsWrapper;
+namespace base {
+template<class T> class PropertyAccessor;
+}
+
class ConstrainedHtmlUIDelegate {
public:
virtual HtmlDialogUIDelegate* GetHtmlDialogUIDelegate() = 0;
@@ -62,7 +65,7 @@ class ConstrainedHtmlUI : public ChromeWebUI {
// Returns a property accessor that can be used to set the
// ConstrainedHtmlUIDelegate property on a TabContents.
- static PropertyAccessor<ConstrainedHtmlUIDelegate*>&
+ static base::PropertyAccessor<ConstrainedHtmlUIDelegate*>&
GetPropertyAccessor();
protected:
diff --git a/chrome/browser/ui/webui/html_dialog_ui.cc b/chrome/browser/ui/webui/html_dialog_ui.cc
index 4d5b678..788ee23 100644
--- a/chrome/browser/ui/webui/html_dialog_ui.cc
+++ b/chrome/browser/ui/webui/html_dialog_ui.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/lazy_instance.h"
+#include "base/property_bag.h"
#include "base/values.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/renderer_host/render_view_host.h"
@@ -14,7 +15,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/common/bindings_policy.h"
-static base::LazyInstance<PropertyAccessor<HtmlDialogUIDelegate*> >
+static base::LazyInstance<base::PropertyAccessor<HtmlDialogUIDelegate*> >
g_html_dialog_ui_property_accessor = LAZY_INSTANCE_INITIALIZER;
HtmlDialogUI::HtmlDialogUI(TabContents* tab_contents)
@@ -37,7 +38,8 @@ void HtmlDialogUI::CloseDialog(const base::ListValue* args) {
}
// static
-PropertyAccessor<HtmlDialogUIDelegate*>& HtmlDialogUI::GetPropertyAccessor() {
+base::PropertyAccessor<HtmlDialogUIDelegate*>&
+ HtmlDialogUI::GetPropertyAccessor() {
return g_html_dialog_ui_property_accessor.Get();
}
diff --git a/chrome/browser/ui/webui/html_dialog_ui.h b/chrome/browser/ui/webui/html_dialog_ui.h
index 9e26f85..390790d 100644
--- a/chrome/browser/ui/webui/html_dialog_ui.h
+++ b/chrome/browser/ui/webui/html_dialog_ui.h
@@ -11,17 +11,17 @@
#include "base/string16.h"
#include "chrome/browser/ui/webui/chrome_web_ui.h"
-#include "content/common/property_bag.h"
#include "googleurl/src/gurl.h"
-namespace gfx {
-class Size;
-}
-
struct ContextMenuParams;
namespace base {
class ListValue;
+template<class T> class PropertyAccessor;
+}
+
+namespace gfx {
+class Size;
}
// Implement this class to receive notifications.
@@ -105,7 +105,7 @@ class HtmlDialogUI : public ChromeWebUI {
// Returns the PropertyBag accessor object used to write the delegate pointer
// into the TabContents (see class-level comment above).
- static PropertyAccessor<HtmlDialogUIDelegate*>& GetPropertyAccessor();
+ static base::PropertyAccessor<HtmlDialogUIDelegate*>& GetPropertyAccessor();
private:
// WebUI