Skip to content

Commit

Permalink
Move base/values.h into the base namespace. This includes a cros DEPS…
Browse files Browse the repository at this point in the history
… roll

with a minor change to that code since libcros also uses base/values.h.

BUG=88666
TEST=none
Review URL: http://codereview.chromium.org/7259019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92208 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dmazzoni@chromium.org committed Jul 12, 2011
1 parent 2338319 commit f3a1c64
Show file tree
Hide file tree
Showing 281 changed files with 1,799 additions and 1,266 deletions.
4 changes: 2 additions & 2 deletions base/json/json_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
#define FRIEND_TEST(test_case_name, test_name)\
friend class test_case_name##_##test_name##_Test

class Value;

namespace base {

class Value;

class BASE_API JSONReader {
public:
// A struct to hold a JS token.
Expand Down
4 changes: 2 additions & 2 deletions base/json/json_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#include "base/base_api.h"
#include "base/basictypes.h"

class Value;

namespace base {

class Value;

class BASE_API JSONWriter {
public:
// Given a root node, generates a JSON string and puts it into |json|.
Expand Down
5 changes: 3 additions & 2 deletions base/value_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
#include "base/base_api.h"

class FilePath;
class StringValue;
class Value;

namespace base {

class StringValue;
class Value;

// The caller takes ownership of the returned value.
BASE_API StringValue* CreateFilePathValue(const FilePath& in_value);
BASE_API bool GetValueAsFilePath(const Value& value, FilePath* file_path);
Expand Down
20 changes: 20 additions & 0 deletions base/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
#include "base/string16.h"
#include "build/build_config.h"

// This file declares "using base::Value", etc. at the bottom, so that
// current code can use these classes without the base namespace. In
// new code, please always use base::Value, etc. or add your own
// "using" declaration.
// http://crbug.com/88666
namespace base {

class BinaryValue;
class DictionaryValue;
class FundamentalValue;
Expand Down Expand Up @@ -455,4 +462,17 @@ class BASE_API ValueSerializer {
virtual Value* Deserialize(int* error_code, std::string* error_str) = 0;
};

} // namespace base

// http://crbug.com/88666
using base::BinaryValue;
using base::DictionaryValue;
using base::FundamentalValue;
using base::ListValue;
using base::StringValue;
using base::Value;
using base::ValueMap;
using base::ValueSerializer;
using base::ValueVector;

#endif // BASE_VALUES_H_
7 changes: 5 additions & 2 deletions chrome/browser/about_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@

#include "base/command_line.h"

class ListValue;
class PrefService;

namespace base {
class ListValue;
}

namespace about_flags {

// Enumeration of OSs.
Expand Down Expand Up @@ -87,7 +90,7 @@ struct Experiment {
void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);

// Get a list of all available experiments. The caller owns the result.
ListValue* GetFlagsExperimentsData(PrefService* prefs);
base::ListValue* GetFlagsExperimentsData(PrefService* prefs);

// Returns true if one of the experiment flags has been flipped since startup.
bool IsRestartNeededToCommitChanges();
Expand Down
21 changes: 12 additions & 9 deletions chrome/browser/accessibility_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
#include <string>

class AccessibilityControlInfo;
class DictionaryValue;
class Profile;

namespace base {
class DictionaryValue;
}

// Use the NotificationService to post the given accessibility
// notification type with AccessibilityControlInfo details to any
// listeners. Will not send if the profile's pause level is nonzero
Expand All @@ -27,7 +30,7 @@ class AccessibilityControlInfo {

// Serialize this class as a DictionaryValue that can be converted to
// a JavaScript object.
virtual void SerializeToDict(DictionaryValue* dict) const;
virtual void SerializeToDict(base::DictionaryValue* dict) const;

// Return the specific type of this control, which will be one of the
// string constants defined in extension_accessibility_api_constants.h.
Expand Down Expand Up @@ -86,7 +89,7 @@ class AccessibilityRadioButtonInfo : public AccessibilityControlInfo {

virtual const char* type() const;

virtual void SerializeToDict(DictionaryValue* dict) const;
virtual void SerializeToDict(base::DictionaryValue* dict) const;

void SetChecked(bool checked) { checked_ = checked; }

Expand All @@ -111,7 +114,7 @@ class AccessibilityCheckboxInfo : public AccessibilityControlInfo {

virtual const char* type() const;

virtual void SerializeToDict(DictionaryValue* dict) const;
virtual void SerializeToDict(base::DictionaryValue* dict) const;

void SetChecked(bool checked) { checked_ = checked; }

Expand All @@ -132,7 +135,7 @@ class AccessibilityTabInfo : public AccessibilityControlInfo {

virtual const char* type() const;

virtual void SerializeToDict(DictionaryValue* dict) const;
virtual void SerializeToDict(base::DictionaryValue* dict) const;

void SetTab(int tab_index, std::string tab_name) {
tab_index_ = tab_index;
Expand Down Expand Up @@ -160,7 +163,7 @@ class AccessibilityComboBoxInfo : public AccessibilityControlInfo {

virtual const char* type() const;

virtual void SerializeToDict(DictionaryValue* dict) const;
virtual void SerializeToDict(base::DictionaryValue* dict) const;

void SetValue(int item_index, const std::string& value) {
item_index_ = item_index;
Expand Down Expand Up @@ -190,7 +193,7 @@ class AccessibilityTextBoxInfo : public AccessibilityControlInfo {

virtual const char* type() const;

virtual void SerializeToDict(DictionaryValue* dict) const;
virtual void SerializeToDict(base::DictionaryValue* dict) const;

void SetValue(
const std::string& value, int selection_start, int selection_end) {
Expand Down Expand Up @@ -223,7 +226,7 @@ class AccessibilityListBoxInfo : public AccessibilityControlInfo {

virtual const char* type() const;

virtual void SerializeToDict(DictionaryValue* dict) const;
virtual void SerializeToDict(base::DictionaryValue* dict) const;

void SetValue(int item_index, std::string value) {
item_index_ = item_index;
Expand Down Expand Up @@ -264,7 +267,7 @@ class AccessibilityMenuItemInfo : public AccessibilityControlInfo {

virtual const char* type() const;

virtual void SerializeToDict(DictionaryValue* dict) const;
virtual void SerializeToDict(base::DictionaryValue* dict) const;

int item_index() const { return item_index_; }
int item_count() const { return item_count_; }
Expand Down
5 changes: 4 additions & 1 deletion chrome/browser/autocomplete/search_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
#include "content/common/url_fetcher.h"

class Profile;

namespace base {
class Value;
}

// Autocomplete provider for searches and suggestions from a search engine.
//
Expand Down Expand Up @@ -199,7 +202,7 @@ class SearchProvider : public AutocompleteProvider,

// Parses the results from the Suggest server and stores up to kMaxMatches of
// them in server_results_. Returns whether parsing succeeded.
bool ParseSuggestResults(Value* root_val,
bool ParseSuggestResults(base::Value* root_val,
bool is_keyword,
const string16& input_text,
SuggestResults* suggest_results);
Expand Down
9 changes: 6 additions & 3 deletions chrome/browser/automation/automation_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,13 @@ class AutomationTabTracker;
class AutomationWindowTracker;
class Browser;
class CreditCard;
class DictionaryValue;
class DownloadItem;
class Extension;
class ExtensionPortContainer;
class ExtensionTestResultNotificationObserver;
class ExternalTabContainer;
class FilePath;
class InitialLoadObserver;
class ListValue;
class LoginHandler;
class MetricEventDurationObserver;
class NavigationController;
Expand All @@ -73,6 +71,10 @@ class RenderViewHost;
class TabContents;
struct AutocompleteMatchData;

namespace base {
class DictionaryValue;
}

namespace gfx {
class Point;
}
Expand Down Expand Up @@ -149,7 +151,8 @@ class AutomationProvider

// Get the DictionaryValue equivalent for a download item. Caller owns the
// DictionaryValue.
DictionaryValue* GetDictionaryFromDownloadItem(const DownloadItem* download);
base::DictionaryValue* GetDictionaryFromDownloadItem(
const DownloadItem* download);

protected:
friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
Expand Down
13 changes: 8 additions & 5 deletions chrome/browser/automation/automation_provider_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@

class AutomationProvider;
class Browser;
class DictionaryValue;
class TabContents;

namespace base {
class DictionaryValue;
class Value;
}

namespace IPC {
class Message;
Expand All @@ -35,7 +38,7 @@ class AutomationJSONReply {

// Send a success reply along with data contained in |value|.
// An empty message will be sent if |value| is NULL.
void SendSuccess(const Value* value);
void SendSuccess(const base::Value* value);

// Send an error reply along with error message |error_message|.
void SendError(const std::string& error_message);
Expand All @@ -48,15 +51,15 @@ class AutomationJSONReply {
// Gets the browser specified by the given dictionary |args|. |args| should
// contain a key 'windex' which refers to the index of the browser. Returns
// true on success and sets |browser|. Otherwise, |error| will be set.
bool GetBrowserFromJSONArgs(DictionaryValue* args,
bool GetBrowserFromJSONArgs(base::DictionaryValue* args,
Browser** browser,
std::string* error) WARN_UNUSED_RESULT;

// Gets the tab specified by the given dictionary |args|. |args| should
// contain a key 'windex' which refers to the index of the parent browser,
// and a key 'tab_index' which refers to the index of the tab in that browser.
// Returns true on success and sets |tab|. Otherwise, |error| will be set.
bool GetTabFromJSONArgs(DictionaryValue* args,
bool GetTabFromJSONArgs(base::DictionaryValue* args,
TabContents** tab,
std::string* error) WARN_UNUSED_RESULT;

Expand All @@ -65,7 +68,7 @@ bool GetTabFromJSONArgs(DictionaryValue* args,
// a key 'tab_index' which refers to the index of the tab in that browser.
// Returns true on success and sets |browser| and |tab|. Otherwise, |error|
// will be set.
bool GetBrowserAndTabFromJSONArgs(DictionaryValue* args,
bool GetBrowserAndTabFromJSONArgs(base::DictionaryValue* args,
Browser** browser,
TabContents** tab,
std::string* error) WARN_UNUSED_RESULT;
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/automation/automation_provider_observers.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class InitialLoadObserver : public NotificationObserver {
// stop_time_ms values may be null if WaitForInitialLoads has not finished.
// Only includes entries for the |tab_count| tabs we are monitoring.
// There is no defined ordering of the return value.
DictionaryValue* GetTimingInformation() const;
base::DictionaryValue* GetTimingInformation() const;

private:
class TabTime;
Expand Down Expand Up @@ -1250,7 +1250,7 @@ class NTPInfoObserver : public NotificationObserver {
scoped_ptr<IPC::Message> reply_message_;
CancelableRequestConsumer* consumer_;
CancelableRequestProvider::Handle request_;
scoped_ptr<DictionaryValue> ntp_info_;
scoped_ptr<base::DictionaryValue> ntp_info_;
history::TopSites* top_sites_;
NotificationRegistrar registrar_;

Expand Down
11 changes: 7 additions & 4 deletions chrome/browser/automation/automation_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@

class AutomationProvider;
class Browser;
class DictionaryValue;
class GURL;
class TabContents;

namespace base {
class DictionaryValue;
}

namespace IPC {
class Message;
}
Expand Down Expand Up @@ -54,19 +57,19 @@ void DeleteCookie(const GURL& url,
// Gets the cookies for the given URL. Uses the JSON interface.
// See |TestingAutomationProvider| for example input.
void GetCookiesJSON(AutomationProvider* provider,
DictionaryValue* args,
base::DictionaryValue* args,
IPC::Message* reply_message);

// Deletes the cookie with the given name for the URL. Uses the JSON interface.
// See |TestingAutomationProvider| for example input.
void DeleteCookieJSON(AutomationProvider* provider,
DictionaryValue* args,
base::DictionaryValue* args,
IPC::Message* reply_message);

// Sets a cookie for the given URL. Uses the JSON interface.
// See |TestingAutomationProvider| for example input.
void SetCookieJSON(AutomationProvider* provider,
DictionaryValue* args,
base::DictionaryValue* args,
IPC::Message* reply_message);

} // namespace automation_util
Expand Down
Loading

0 comments on commit f3a1c64

Please sign in to comment.