summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-30 00:50:04 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-30 00:50:04 +0000
commitbdaab67c485eee51a098c7b34544c5d18bf725af (patch)
tree31e0c087b57c538ef91b6598040f2b7f2293505d /chrome/browser/search_engines
parentfbc7678b2f73707962861c99eb4c809604ddd611 (diff)
downloadchromium_src-bdaab67c485eee51a098c7b34544c5d18bf725af.zip
chromium_src-bdaab67c485eee51a098c7b34544c5d18bf725af.tar.gz
chromium_src-bdaab67c485eee51a098c7b34544c5d18bf725af.tar.bz2
Remove wstring from TableModel.
BUG=23581 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6044007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r--chrome/browser/search_engines/template_url_table_model.cc25
-rw-r--r--chrome/browser/search_engines/template_url_table_model.h18
2 files changed, 22 insertions, 21 deletions
diff --git a/chrome/browser/search_engines/template_url_table_model.cc b/chrome/browser/search_engines/template_url_table_model.cc
index 0acbb37..12189f1 100644
--- a/chrome/browser/search_engines/template_url_table_model.cc
+++ b/chrome/browser/search_engines/template_url_table_model.cc
@@ -4,9 +4,6 @@
#include "chrome/browser/search_engines/template_url_table_model.h"
-#include <string>
-#include <vector>
-
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/table_model_observer.h"
@@ -177,21 +174,21 @@ int TemplateURLTableModel::RowCount() {
return static_cast<int>(entries_.size());
}
-std::wstring TemplateURLTableModel::GetText(int row, int col_id) {
+string16 TemplateURLTableModel::GetText(int row, int col_id) {
DCHECK(row >= 0 && row < RowCount());
const TemplateURL& url = entries_[row]->template_url();
switch (col_id) {
case IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN: {
- std::wstring url_short_name = url.short_name();
+ string16 url_short_name = WideToUTF16Hack(url.short_name());
// TODO(xji): Consider adding a special case if the short name is a URL,
// since those should always be displayed LTR. Please refer to
// http://crbug.com/6726 for more information.
base::i18n::AdjustStringForLocaleDirection(&url_short_name);
if (template_url_model_->GetDefaultSearchProvider() == &url) {
- return UTF16ToWideHack(
- l10n_util::GetStringFUTF16(IDS_SEARCH_ENGINES_EDITOR_DEFAULT_ENGINE,
- WideToUTF16Hack(url_short_name)));
+ return l10n_util::GetStringFUTF16(
+ IDS_SEARCH_ENGINES_EDITOR_DEFAULT_ENGINE,
+ url_short_name);
}
return url_short_name;
}
@@ -200,12 +197,12 @@ std::wstring TemplateURLTableModel::GetText(int row, int col_id) {
// Keyword should be domain name. Force it to have LTR directionality.
string16 keyword = WideToUTF16(url.keyword());
keyword = base::i18n::GetDisplayStringInLTRDirectionality(keyword);
- return UTF16ToWide(keyword);
+ return keyword;
}
default:
NOTREACHED();
- return std::wstring();
+ return string16();
}
}
@@ -226,14 +223,14 @@ TemplateURLTableModel::Groups TemplateURLTableModel::GetGroups() {
Groups groups;
Group search_engine_group;
- search_engine_group.title = UTF16ToWideHack(
- l10n_util::GetStringUTF16(IDS_SEARCH_ENGINES_EDITOR_MAIN_SEPARATOR));
+ search_engine_group.title =
+ l10n_util::GetStringUTF16(IDS_SEARCH_ENGINES_EDITOR_MAIN_SEPARATOR);
search_engine_group.id = kMainGroupID;
groups.push_back(search_engine_group);
Group other_group;
- other_group.title = UTF16ToWideHack(
- l10n_util::GetStringUTF16(IDS_SEARCH_ENGINES_EDITOR_OTHER_SEPARATOR));
+ other_group.title =
+ l10n_util::GetStringUTF16(IDS_SEARCH_ENGINES_EDITOR_OTHER_SEPARATOR);
other_group.id = kOtherGroupID;
groups.push_back(other_group);
diff --git a/chrome/browser/search_engines/template_url_table_model.h b/chrome/browser/search_engines/template_url_table_model.h
index 03bb43a..95ca739 100644
--- a/chrome/browser/search_engines/template_url_table_model.h
+++ b/chrome/browser/search_engines/template_url_table_model.h
@@ -6,7 +6,11 @@
#define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_TABLE_MODEL_H_
#pragma once
+#include <string>
+#include <vector>
+
#include "app/table_model.h"
+#include "base/compiler_specific.h"
#include "base/string16.h"
#include "chrome/browser/search_engines/template_url_model_observer.h"
@@ -38,13 +42,13 @@ class TemplateURLTableModel : public TableModel,
void Reload();
// TableModel overrides.
- virtual int RowCount();
- virtual std::wstring GetText(int row, int column);
- virtual SkBitmap GetIcon(int row);
- virtual void SetObserver(TableModelObserver* observer);
- virtual bool HasGroups();
- virtual Groups GetGroups();
- virtual int GetGroupID(int row);
+ virtual int RowCount() OVERRIDE;
+ virtual string16 GetText(int row, int column) OVERRIDE;
+ virtual SkBitmap GetIcon(int row) OVERRIDE;
+ virtual void SetObserver(TableModelObserver* observer) OVERRIDE;
+ virtual bool HasGroups() OVERRIDE;
+ virtual Groups GetGroups() OVERRIDE;
+ virtual int GetGroupID(int row) OVERRIDE;
// Removes the entry at the specified index.
void Remove(int index);