| Index: components/history/core/browser/android/android_history_types.h
|
| diff --git a/components/history/core/android/android_history_types.h b/components/history/core/browser/android/android_history_types.h
|
| similarity index 79%
|
| rename from components/history/core/android/android_history_types.h
|
| rename to components/history/core/browser/android/android_history_types.h
|
| index 3c642f380dd63d1ae54ec3416ca7bfe03a045f60..39693a446fa957240e976220b9d158decd5265fb 100644
|
| --- a/components/history/core/android/android_history_types.h
|
| +++ b/components/history/core/browser/android/android_history_types.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef COMPONENTS_HISTORY_CORE_ANDROID_ANDROID_HISTORY_TYPES_H_
|
| -#define COMPONENTS_HISTORY_CORE_ANDROID_ANDROID_HISTORY_TYPES_H_
|
| +#ifndef COMPONENTS_HISTORY_CORE_BROWSER_ANDROID_ANDROID_HISTORY_TYPES_H_
|
| +#define COMPONENTS_HISTORY_CORE_BROWSER_ANDROID_ANDROID_HISTORY_TYPES_H_
|
|
|
| #include <map>
|
|
|
| @@ -42,7 +42,7 @@ class HistoryAndBookmarkRow {
|
| RAW_URL,
|
| PARENT_ID,
|
| URL_ID,
|
| - COLUMN_END // This must be the last.
|
| + COLUMN_END // This must be the last.
|
| };
|
|
|
| HistoryAndBookmarkRow();
|
| @@ -58,63 +58,49 @@ class HistoryAndBookmarkRow {
|
| set_value_explicitly(URL);
|
| url_ = url;
|
| }
|
| - const GURL& url() const {
|
| - return url_;
|
| - }
|
| + const GURL& url() const { return url_; }
|
|
|
| // Raw input URL
|
| void set_raw_url(const std::string& raw_url) {
|
| set_value_explicitly(RAW_URL);
|
| raw_url_ = raw_url;
|
| }
|
| - const std::string& raw_url() const {
|
| - return raw_url_;
|
| - }
|
| + const std::string& raw_url() const { return raw_url_; }
|
|
|
| // The title of page.
|
| void set_title(const base::string16& title) {
|
| set_value_explicitly(TITLE);
|
| title_ = title;
|
| }
|
| - const base::string16& title() const {
|
| - return title_;
|
| - }
|
| + const base::string16& title() const { return title_; }
|
|
|
| // The page's first visit time.
|
| void set_created(const base::Time created) {
|
| set_value_explicitly(CREATED);
|
| created_ = created;
|
| }
|
| - const base::Time& created() const {
|
| - return created_;
|
| - }
|
| + const base::Time& created() const { return created_; }
|
|
|
| // The page's last visit time.
|
| void set_last_visit_time(const base::Time last_visit_time) {
|
| set_value_explicitly(LAST_VISIT_TIME);
|
| last_visit_time_ = last_visit_time;
|
| }
|
| - const base::Time& last_visit_time() const {
|
| - return last_visit_time_;
|
| - }
|
| + const base::Time& last_visit_time() const { return last_visit_time_; }
|
|
|
| // The visit times
|
| void set_visit_count(int visit_count) {
|
| set_value_explicitly(VISIT_COUNT);
|
| visit_count_ = visit_count;
|
| }
|
| - int visit_count() const {
|
| - return visit_count_;
|
| - }
|
| + int visit_count() const { return visit_count_; }
|
|
|
| // Whether the page is bookmarked.
|
| void set_is_bookmark(bool is_bookmark) {
|
| set_value_explicitly(BOOKMARK);
|
| is_bookmark_ = is_bookmark;
|
| }
|
| - bool is_bookmark() const {
|
| - return is_bookmark_;
|
| - }
|
| + bool is_bookmark() const { return is_bookmark_; }
|
|
|
| // The favicon related to page if any.
|
| void set_favicon(const scoped_refptr<base::RefCountedMemory>& data) {
|
| @@ -125,36 +111,28 @@ class HistoryAndBookmarkRow {
|
| return favicon_;
|
| }
|
|
|
| - bool favicon_valid() const {
|
| - return favicon_.get() && favicon_->size();
|
| - }
|
| + bool favicon_valid() const { return favicon_.get() && favicon_->size(); }
|
|
|
| // The id of android url.
|
| void set_id(AndroidURLID id) {
|
| set_value_explicitly(ID);
|
| id_ = id;
|
| }
|
| - AndroidURLID id() const {
|
| - return id_;
|
| - }
|
| + AndroidURLID id() const { return id_; }
|
|
|
| // The id of the parent folder containing the bookmark, if any.
|
| void set_parent_id(int64 parent_id) {
|
| set_value_explicitly(PARENT_ID);
|
| parent_id_ = parent_id;
|
| }
|
| - const int64 parent_id() const {
|
| - return parent_id_;
|
| - }
|
| + const int64 parent_id() const { return parent_id_; }
|
|
|
| // The internal URLID
|
| void set_url_id(URLID url_id) {
|
| set_value_explicitly(URL_ID);
|
| url_id_ = url_id;
|
| }
|
| - URLID url_id() const {
|
| - return url_id_;
|
| - }
|
| + URLID url_id() const { return url_id_; }
|
|
|
| // Returns true if the given |id| has been set explicitly.
|
| bool is_value_set_explicitly(ColumnID id) const {
|
| @@ -162,9 +140,7 @@ class HistoryAndBookmarkRow {
|
| }
|
|
|
| private:
|
| - void set_value_explicitly(ColumnID id) {
|
| - values_set_.insert(id);
|
| - }
|
| + void set_value_explicitly(ColumnID id) { values_set_.insert(id); }
|
|
|
| AndroidURLID id_;
|
| GURL url_;
|
| @@ -194,14 +170,7 @@ class HistoryAndBookmarkRow {
|
| // The defult copy constructor is used.
|
| class SearchRow {
|
| public:
|
| - enum ColumnID {
|
| - ID,
|
| - SEARCH_TERM,
|
| - SEARCH_TIME,
|
| - URL,
|
| - KEYWORD_ID,
|
| - COLUMN_END
|
| - };
|
| + enum ColumnID { ID, SEARCH_TERM, SEARCH_TIME, URL, KEYWORD_ID, COLUMN_END };
|
|
|
| SearchRow();
|
| virtual ~SearchRow();
|
| @@ -211,55 +180,43 @@ class SearchRow {
|
|
|
| static ColumnID GetColumnID(const std::string& name);
|
|
|
| - SearchTermID id() const {
|
| - return id_;
|
| - }
|
| + SearchTermID id() const { return id_; }
|
| void set_id(SearchTermID id) {
|
| set_value_explicitly(SearchRow::ID);
|
| id_ = id;
|
| }
|
|
|
| - const base::string16& search_term() const {
|
| - return search_term_;
|
| - }
|
| + const base::string16& search_term() const { return search_term_; }
|
| void set_search_term(const base::string16& search_term) {
|
| set_value_explicitly(SearchRow::SEARCH_TERM);
|
| search_term_ = search_term;
|
| }
|
|
|
| - const base::Time search_time() const {
|
| - return search_time_;
|
| - }
|
| + const base::Time search_time() const { return search_time_; }
|
| void set_search_time(const base::Time& time) {
|
| set_value_explicitly(SearchRow::SEARCH_TIME);
|
| search_time_ = time;
|
| }
|
|
|
| - const GURL& url() const {
|
| - return url_;
|
| - }
|
| + const GURL& url() const { return url_; }
|
| void set_url(const GURL& url) {
|
| set_value_explicitly(SearchRow::URL);
|
| url_ = url;
|
| }
|
|
|
| - KeywordID keyword_id() const {
|
| - return keyword_id_;
|
| - }
|
| + KeywordID keyword_id() const { return keyword_id_; }
|
| void set_keyword_id(KeywordID keyword_id) {
|
| set_value_explicitly(SearchRow::KEYWORD_ID);
|
| keyword_id_ = keyword_id;
|
| }
|
|
|
| - // Returns true if the given |id| has been set explicitly.
|
| + // Returns true if the given |id| has been set explicitly.
|
| bool is_value_set_explicitly(ColumnID id) const {
|
| return values_set_.find(id) != values_set_.end();
|
| }
|
|
|
| private:
|
| - void set_value_explicitly(ColumnID id) {
|
| - values_set_.insert(id);
|
| - }
|
| + void set_value_explicitly(ColumnID id) { values_set_.insert(id); }
|
|
|
| SearchTermID id_;
|
| base::string16 search_term_;
|
| @@ -310,15 +267,11 @@ class AndroidStatement {
|
| AndroidStatement(sql::Statement* statement, int favicon_index);
|
| ~AndroidStatement();
|
|
|
| - sql::Statement* statement() {
|
| - return statement_.get();
|
| - }
|
| + sql::Statement* statement() { return statement_.get(); }
|
|
|
| // The favicon index in statement; -1 is returned if favicon is not in
|
| // the statement.
|
| - int favicon_index() const {
|
| - return favicon_index_;
|
| - }
|
| + int favicon_index() const { return favicon_index_; }
|
|
|
| private:
|
| scoped_ptr<sql::Statement> statement_;
|
| @@ -329,4 +282,4 @@ class AndroidStatement {
|
|
|
| } // namespace history
|
|
|
| -#endif // COMPONENTS_HISTORY_CORE_ANDROID_ANDROID_HISTORY_TYPES_H_
|
| +#endif // COMPONENTS_HISTORY_CORE_BROWSER_ANDROID_ANDROID_HISTORY_TYPES_H_
|
|
|