summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-16 18:02:04 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-16 18:02:04 +0000
commit48401bd0474deedd8962fc703f3e0b461eab6aab (patch)
tree51840849c621d0c50179e7442a8d6fbb9eaa66f5 /ui
parent584700ccbc2f273f407346dfc7863d2879a6a76c (diff)
downloadchromium_src-48401bd0474deedd8962fc703f3e0b461eab6aab.zip
chromium_src-48401bd0474deedd8962fc703f3e0b461eab6aab.tar.gz
chromium_src-48401bd0474deedd8962fc703f3e0b461eab6aab.tar.bz2
ui/app_list: Use base::string16 now that string16 was moved into base namespace.
base/string16.h was moved into base namespace in r191198 by Brett. BUG=None TBR=ben@chromium.org,xiyuan@chromium.org Review URL: https://chromiumcodereview.appspot.com/16945004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206645 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/app_list/app_list_menu.cc2
-rw-r--r--ui/app_list/app_list_view_delegate.h4
-rw-r--r--ui/app_list/cocoa/app_list_view_controller.mm2
-rw-r--r--ui/app_list/cocoa/apps_search_box_controller.mm4
-rw-r--r--ui/app_list/cocoa/apps_search_box_controller_unittest.mm7
-rw-r--r--ui/app_list/cocoa/apps_search_results_controller.mm4
-rw-r--r--ui/app_list/cocoa/apps_search_results_controller_unittest.mm2
-rw-r--r--ui/app_list/search_box_model.cc4
-rw-r--r--ui/app_list/search_box_model.h12
-rw-r--r--ui/app_list/search_result.cc2
-rw-r--r--ui/app_list/search_result.h16
-rw-r--r--ui/app_list/signin_delegate.h10
-rw-r--r--ui/app_list/test/app_list_test_view_delegate.cc8
-rw-r--r--ui/app_list/test/app_list_test_view_delegate.h4
-rw-r--r--ui/app_list/views/app_list_main_view.cc2
-rw-r--r--ui/app_list/views/app_list_menu_views.cc10
-rw-r--r--ui/app_list/views/search_box_view.cc6
-rw-r--r--ui/app_list/views/search_box_view.h2
-rw-r--r--ui/app_list/views/search_result_view.cc2
19 files changed, 52 insertions, 51 deletions
diff --git a/ui/app_list/app_list_menu.cc b/ui/app_list/app_list_menu.cc
index c3d464e..95d6ac38 100644
--- a/ui/app_list/app_list_menu.cc
+++ b/ui/app_list/app_list_menu.cc
@@ -21,7 +21,7 @@ AppListMenu::AppListMenu(AppListViewDelegate* delegate)
AppListMenu::~AppListMenu() {}
void AppListMenu::InitMenu() {
- menu_model_.AddItem(CURRENT_USER, string16());
+ menu_model_.AddItem(CURRENT_USER, base::string16());
menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
menu_model_.AddItem(SHOW_SETTINGS, l10n_util::GetStringUTF16(
diff --git a/ui/app_list/app_list_view_delegate.h b/ui/app_list/app_list_view_delegate.h
index d675447..1e1150b 100644
--- a/ui/app_list/app_list_view_delegate.h
+++ b/ui/app_list/app_list_view_delegate.h
@@ -66,10 +66,10 @@ class APP_LIST_EXPORT AppListViewDelegate {
virtual gfx::ImageSkia GetWindowIcon() = 0;
// Returns the name of the current user.
- virtual string16 GetCurrentUserName() = 0;
+ virtual base::string16 GetCurrentUserName() = 0;
// Returns the email of the current user.
- virtual string16 GetCurrentUserEmail() = 0;
+ virtual base::string16 GetCurrentUserEmail() = 0;
// Open the settings UI.
virtual void OpenSettings() = 0;
diff --git a/ui/app_list/cocoa/app_list_view_controller.mm b/ui/app_list/cocoa/app_list_view_controller.mm
index d88f831..eb7c5d2 100644
--- a/ui/app_list/cocoa/app_list_view_controller.mm
+++ b/ui/app_list/cocoa/app_list_view_controller.mm
@@ -252,7 +252,7 @@ const NSTimeInterval kResultsAnimationDuration = 0.2;
if (!searchBoxModel || !delegate_)
return;
- string16 query;
+ base::string16 query;
TrimWhitespace(searchBoxModel->text(), TRIM_ALL, &query);
BOOL shouldShowSearch = !query.empty();
[self revealSearchResults:shouldShowSearch];
diff --git a/ui/app_list/cocoa/apps_search_box_controller.mm b/ui/app_list/cocoa/apps_search_box_controller.mm
index ad35dba..8e68425 100644
--- a/ui/app_list/cocoa/apps_search_box_controller.mm
+++ b/ui/app_list/cocoa/apps_search_box_controller.mm
@@ -36,7 +36,7 @@ class SearchBoxModelObserverBridge : public SearchBoxModelObserver {
SearchBoxModelObserverBridge(AppsSearchBoxController* parent);
virtual ~SearchBoxModelObserverBridge();
- void SetSearchText(const string16& text);
+ void SetSearchText(const base::string16& text);
virtual void IconChanged() OVERRIDE;
virtual void HintTextChanged() OVERRIDE;
@@ -69,7 +69,7 @@ SearchBoxModel* SearchBoxModelObserverBridge::GetModel() {
return searchBoxModel;
}
-void SearchBoxModelObserverBridge::SetSearchText(const string16& text) {
+void SearchBoxModelObserverBridge::SetSearchText(const base::string16& text) {
SearchBoxModel* model = GetModel();
model->RemoveObserver(this);
model->SetText(text);
diff --git a/ui/app_list/cocoa/apps_search_box_controller_unittest.mm b/ui/app_list/cocoa/apps_search_box_controller_unittest.mm
index ee47687..2c75127 100644
--- a/ui/app_list/cocoa/apps_search_box_controller_unittest.mm
+++ b/ui/app_list/cocoa/apps_search_box_controller_unittest.mm
@@ -90,12 +90,13 @@ TEST_VIEW(AppsSearchBoxControllerTest, [apps_search_box_controller_ view]);
// Test the search box initialization, and search input and clearing.
TEST_F(AppsSearchBoxControllerTest, SearchBoxModel) {
app_list::SearchBoxModel* model = [delegate_ searchBoxModel];
- const string16 hit_text(ASCIIToUTF16("hint")); // Usually localized "Search".
+ // Usually localized "Search".
+ const base::string16 hit_text(ASCIIToUTF16("hint"));
model->SetHintText(hit_text);
EXPECT_NSEQ(base::SysUTF16ToNSString(hit_text),
[[[apps_search_box_controller_ searchTextField] cell] placeholderString]);
- const string16 search_text(ASCIIToUTF16("test"));
+ const base::string16 search_text(ASCIIToUTF16("test"));
model->SetText(search_text);
EXPECT_NSEQ(base::SysUTF16ToNSString(search_text),
[[apps_search_box_controller_ searchTextField] stringValue]);
@@ -104,7 +105,7 @@ TEST_F(AppsSearchBoxControllerTest, SearchBoxModel) {
// Updates from the view should update the model and notify the delegate.
[apps_search_box_controller_ clearSearch];
- EXPECT_EQ(string16(), model->text());
+ EXPECT_EQ(base::string16(), model->text());
EXPECT_NSEQ([NSString string],
[[apps_search_box_controller_ searchTextField] stringValue]);
EXPECT_EQ(1, [delegate_ textChangeCount]);
diff --git a/ui/app_list/cocoa/apps_search_results_controller.mm b/ui/app_list/cocoa/apps_search_results_controller.mm
index 82157ea..ecc1660 100644
--- a/ui/app_list/cocoa/apps_search_results_controller.mm
+++ b/ui/app_list/cocoa/apps_search_results_controller.mm
@@ -55,7 +55,7 @@ const NSBackgroundStyle kBackgroundHovered = NSBackgroundStyleRaised;
- (id)initWithSearchResult:(app_list::SearchResult*)result;
-- (NSMutableAttributedString*)createRenderText:(const string16&)content
+- (NSMutableAttributedString*)createRenderText:(const base::string16&)content
tags:(const app_list::SearchResult::Tags&)tags;
- (NSAttributedString*)createResultsAttributedStringWithModel
@@ -297,7 +297,7 @@ const NSBackgroundStyle kBackgroundHovered = NSBackgroundStyleRaised;
return self;
}
-- (NSMutableAttributedString*)createRenderText:(const string16&)content
+- (NSMutableAttributedString*)createRenderText:(const base::string16&)content
tags:(const app_list::SearchResult::Tags&)tags {
NSFont* boldFont = nil;
scoped_nsobject<NSMutableParagraphStyle> paragraphStyle(
diff --git a/ui/app_list/cocoa/apps_search_results_controller_unittest.mm b/ui/app_list/cocoa/apps_search_results_controller_unittest.mm
index 7ed263a..757c68f 100644
--- a/ui/app_list/cocoa/apps_search_results_controller_unittest.mm
+++ b/ui/app_list/cocoa/apps_search_results_controller_unittest.mm
@@ -98,7 +98,7 @@ void AppsSearchResultsControllerTest::ExpectConsistent() {
// model data that should have been reloaded has been reloaded in the view.
for (NSInteger i = 0; i < item_count; ++i) {
SearchResult* result = ModelResultAt(i);
- string16 string_in_model = result->title();
+ base::string16 string_in_model = result->title();
if (!result->details().empty())
string_in_model += ASCIIToUTF16("\n") + result->details();
EXPECT_NSEQ(base::SysUTF16ToNSString(string_in_model),
diff --git a/ui/app_list/search_box_model.cc b/ui/app_list/search_box_model.cc
index c885086..1852f75 100644
--- a/ui/app_list/search_box_model.cc
+++ b/ui/app_list/search_box_model.cc
@@ -19,7 +19,7 @@ void SearchBoxModel::SetIcon(const gfx::ImageSkia& icon) {
FOR_EACH_OBSERVER(SearchBoxModelObserver, observers_, IconChanged());
}
-void SearchBoxModel::SetHintText(const string16& hint_text) {
+void SearchBoxModel::SetHintText(const base::string16& hint_text) {
if (hint_text_ == hint_text)
return;
@@ -37,7 +37,7 @@ void SearchBoxModel::SetSelectionModel(const gfx::SelectionModel& sel) {
SelectionModelChanged());
}
-void SearchBoxModel::SetText(const string16& text) {
+void SearchBoxModel::SetText(const base::string16& text) {
if (text_ == text)
return;
diff --git a/ui/app_list/search_box_model.h b/ui/app_list/search_box_model.h
index 77beda8..764281f 100644
--- a/ui/app_list/search_box_model.h
+++ b/ui/app_list/search_box_model.h
@@ -31,8 +31,8 @@ class APP_LIST_EXPORT SearchBoxModel {
const gfx::ImageSkia& icon() const { return icon_; }
// Sets/gets the hint text to display when there is in input.
- void SetHintText(const string16& hint_text);
- const string16& hint_text() const { return hint_text_; }
+ void SetHintText(const base::string16& hint_text);
+ const base::string16& hint_text() const { return hint_text_; }
// Sets/gets the selection model for the search box's Textfield.
void SetSelectionModel(const gfx::SelectionModel& sel);
@@ -41,17 +41,17 @@ class APP_LIST_EXPORT SearchBoxModel {
}
// Sets/gets the text for the search box's Textfield.
- void SetText(const string16& text);
- const string16& text() const { return text_; }
+ void SetText(const base::string16& text);
+ const base::string16& text() const { return text_; }
void AddObserver(SearchBoxModelObserver* observer);
void RemoveObserver(SearchBoxModelObserver* observer);
private:
gfx::ImageSkia icon_;
- string16 hint_text_;
+ base::string16 hint_text_;
gfx::SelectionModel selection_model_;
- string16 text_;
+ base::string16 text_;
ObserverList<SearchBoxModelObserver> observers_;
diff --git a/ui/app_list/search_result.cc b/ui/app_list/search_result.cc
index 2d62af5..c6bf2cb 100644
--- a/ui/app_list/search_result.cc
+++ b/ui/app_list/search_result.cc
@@ -11,7 +11,7 @@ namespace app_list {
SearchResult::ActionIconSet::ActionIconSet(const gfx::ImageSkia& base_image,
const gfx::ImageSkia& hover_image,
const gfx::ImageSkia& pressed_image,
- const string16& tooltip_text)
+ const base::string16& tooltip_text)
: base_image(base_image),
hover_image(hover_image),
pressed_image(pressed_image),
diff --git a/ui/app_list/search_result.h b/ui/app_list/search_result.h
index ae3e76e..6fab696 100644
--- a/ui/app_list/search_result.h
+++ b/ui/app_list/search_result.h
@@ -55,14 +55,14 @@ class APP_LIST_EXPORT SearchResult {
ActionIconSet(const gfx::ImageSkia& base_image,
const gfx::ImageSkia& hover_image,
const gfx::ImageSkia& pressed_image,
- const string16& tooltip_text);
+ const base::string16& tooltip_text);
~ActionIconSet();
gfx::ImageSkia base_image;
gfx::ImageSkia hover_image;
gfx::ImageSkia pressed_image;
- string16 tooltip_text;
+ base::string16 tooltip_text;
};
typedef std::vector<ActionIconSet> ActionIconSets;
@@ -72,14 +72,14 @@ class APP_LIST_EXPORT SearchResult {
const gfx::ImageSkia& icon() const { return icon_; }
void SetIcon(const gfx::ImageSkia& icon);
- const string16& title() const { return title_; }
- void set_title(const string16& title) { title_ = title;}
+ const base::string16& title() const { return title_; }
+ void set_title(const base::string16& title) { title_ = title;}
const Tags& title_tags() const { return title_tags_; }
void set_title_tags(const Tags& tags) { title_tags_ = tags; }
- const string16& details() const { return details_; }
- void set_details(const string16& details) { details_ = details; }
+ const base::string16& details() const { return details_; }
+ void set_details(const base::string16& details) { details_ = details; }
const Tags& details_tags() const { return details_tags_; }
void set_details_tags(const Tags& tags) { details_tags_ = tags; }
@@ -99,10 +99,10 @@ class APP_LIST_EXPORT SearchResult {
private:
gfx::ImageSkia icon_;
- string16 title_;
+ base::string16 title_;
Tags title_tags_;
- string16 details_;
+ base::string16 details_;
Tags details_tags_;
// Optional list of icons representing additional actions that can be
diff --git a/ui/app_list/signin_delegate.h b/ui/app_list/signin_delegate.h
index fe2b94b..eda67f4 100644
--- a/ui/app_list/signin_delegate.h
+++ b/ui/app_list/signin_delegate.h
@@ -24,11 +24,11 @@ class APP_LIST_EXPORT SigninDelegate {
virtual void OpenLearnMore() = 0;
virtual void OpenSettings() = 0;
- virtual string16 GetSigninHeading() = 0;
- virtual string16 GetSigninText() = 0;
- virtual string16 GetSigninButtonText() = 0;
- virtual string16 GetLearnMoreLinkText() = 0;
- virtual string16 GetSettingsLinkText() = 0;
+ virtual base::string16 GetSigninHeading() = 0;
+ virtual base::string16 GetSigninText() = 0;
+ virtual base::string16 GetSigninButtonText() = 0;
+ virtual base::string16 GetLearnMoreLinkText() = 0;
+ virtual base::string16 GetSettingsLinkText() = 0;
void AddObserver(SigninDelegateObserver* observer);
void RemoveObserver(SigninDelegateObserver* observer);
diff --git a/ui/app_list/test/app_list_test_view_delegate.cc b/ui/app_list/test/app_list_test_view_delegate.cc
index 5569c09..6012933 100644
--- a/ui/app_list/test/app_list_test_view_delegate.cc
+++ b/ui/app_list/test/app_list_test_view_delegate.cc
@@ -35,12 +35,12 @@ gfx::ImageSkia AppListTestViewDelegate::GetWindowIcon() {
return gfx::ImageSkia();
}
-string16 AppListTestViewDelegate::GetCurrentUserName() {
- return string16();
+base::string16 AppListTestViewDelegate::GetCurrentUserName() {
+ return base::string16();
}
-string16 AppListTestViewDelegate::GetCurrentUserEmail() {
- return string16();
+base::string16 AppListTestViewDelegate::GetCurrentUserEmail() {
+ return base::string16();
}
} // namespace test
diff --git a/ui/app_list/test/app_list_test_view_delegate.h b/ui/app_list/test/app_list_test_view_delegate.h
index c3ca18a..f28fb050 100644
--- a/ui/app_list/test/app_list_test_view_delegate.h
+++ b/ui/app_list/test/app_list_test_view_delegate.h
@@ -37,8 +37,8 @@ class AppListTestViewDelegate : public AppListViewDelegate {
virtual void ViewClosing() OVERRIDE {}
virtual void ViewActivationChanged(bool active) OVERRIDE {}
virtual gfx::ImageSkia GetWindowIcon() OVERRIDE;
- virtual string16 GetCurrentUserName() OVERRIDE;
- virtual string16 GetCurrentUserEmail() OVERRIDE;
+ virtual base::string16 GetCurrentUserName() OVERRIDE;
+ virtual base::string16 GetCurrentUserEmail() OVERRIDE;
virtual void OpenSettings() OVERRIDE {}
virtual void OpenHelp() OVERRIDE {}
virtual void OpenFeedback() OVERRIDE {}
diff --git a/ui/app_list/views/app_list_main_view.cc b/ui/app_list/views/app_list_main_view.cc
index 206fa9f..f7a9159 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -189,7 +189,7 @@ void AppListMainView::ActivateApp(AppListItemModel* item, int event_flags) {
}
void AppListMainView::QueryChanged(SearchBoxView* sender) {
- string16 query;
+ base::string16 query;
TrimWhitespace(model_->search_box()->text(), TRIM_ALL, &query);
bool should_show_search = !query.empty();
contents_view_->ShowSearchResults(should_show_search);
diff --git a/ui/app_list/views/app_list_menu_views.cc b/ui/app_list/views/app_list_menu_views.cc
index 1d8a4e4..1f45880 100644
--- a/ui/app_list/views/app_list_menu_views.cc
+++ b/ui/app_list/views/app_list_menu_views.cc
@@ -23,8 +23,8 @@ namespace {
class CurrentUserView : public views::View {
public:
- CurrentUserView(const string16& user_name,
- const string16& user_email,
+ CurrentUserView(const base::string16& user_name,
+ const base::string16& user_email,
const gfx::ImageSkia& icon) {
const views::MenuConfig& menu_config = views::MenuConfig::instance(NULL);
views::GridLayout* layout = new views::GridLayout(this);
@@ -74,8 +74,8 @@ class CurrentUserMenuItem : public MenuItemView {
public:
CurrentUserMenuItem(MenuItemView* parent,
int id,
- const string16& user_name,
- const string16& user_email,
+ const base::string16& user_name,
+ const base::string16& user_email,
const gfx::ImageSkia& icon)
: MenuItemView(parent, id, MenuItemView::NORMAL) {
AddChildView(new CurrentUserView(user_name, user_email, icon));
@@ -145,4 +145,4 @@ void AppListMenuViews::Cancel() {
menu_runner_->Cancel();
}
-} // namespace app_list \ No newline at end of file
+} // namespace app_list
diff --git a/ui/app_list/views/search_box_view.cc b/ui/app_list/views/search_box_view.cc
index f3fcec9..1187ecf 100644
--- a/ui/app_list/views/search_box_view.cc
+++ b/ui/app_list/views/search_box_view.cc
@@ -42,7 +42,7 @@ SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate,
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
#if !defined(OS_CHROMEOS)
- menu_button_ = new views::MenuButton(NULL, string16(), this, false);
+ menu_button_ = new views::MenuButton(NULL, base::string16(), this, false);
menu_button_->set_border(NULL);
menu_button_->SetIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_NORMAL));
menu_button_->SetHoverIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_HOVER));
@@ -83,7 +83,7 @@ bool SearchBoxView::HasSearch() const {
}
void SearchBoxView::ClearSearch() {
- search_box_->SetText(string16());
+ search_box_->SetText(base::string16());
// Updates model and fires query changed manually because SetText() above
// does not generate ContentsChanged() notification.
UpdateModel();
@@ -144,7 +144,7 @@ void SearchBoxView::NotifyQueryChanged() {
}
void SearchBoxView::ContentsChanged(views::Textfield* sender,
- const string16& new_contents) {
+ const base::string16& new_contents) {
UpdateModel();
NotifyQueryChanged();
}
diff --git a/ui/app_list/views/search_box_view.h b/ui/app_list/views/search_box_view.h
index 81065cd2..6b2b43f 100644
--- a/ui/app_list/views/search_box_view.h
+++ b/ui/app_list/views/search_box_view.h
@@ -63,7 +63,7 @@ class SearchBoxView : public views::View,
// Overridden from views::TextfieldController:
virtual void ContentsChanged(views::Textfield* sender,
- const string16& new_contents) OVERRIDE;
+ const base::string16& new_contents) OVERRIDE;
virtual bool HandleKeyEvent(views::Textfield* sender,
const ui::KeyEvent& key_event) OVERRIDE;
diff --git a/ui/app_list/views/search_result_view.cc b/ui/app_list/views/search_result_view.cc
index 73dfd00..c9133ec 100644
--- a/ui/app_list/views/search_result_view.cc
+++ b/ui/app_list/views/search_result_view.cc
@@ -52,7 +52,7 @@ class IconView : public views::ImageView {
// Creates a RenderText of given |text| and |styles|. Caller takes ownership
// of returned RenderText.
-gfx::RenderText* CreateRenderText(const string16& text,
+gfx::RenderText* CreateRenderText(const base::string16& text,
const app_list::SearchResult::Tags& tags) {
gfx::RenderText* render_text = gfx::RenderText::CreateInstance();
render_text->SetText(text);