OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h" | 5 #include "chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h" |
6 | 6 |
7 #include "base/numerics/safe_conversions.h" | 7 #include "base/numerics/safe_conversions.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 } | 254 } |
255 | 255 |
256 GetWidget()->Close(); | 256 GetWidget()->Close(); |
257 } | 257 } |
258 | 258 |
259 void BookmarkAppBubbleView::UpdateAddButtonState() { | 259 void BookmarkAppBubbleView::UpdateAddButtonState() { |
260 add_button_->SetEnabled(!GetTrimmedTitle().empty()); | 260 add_button_->SetEnabled(!GetTrimmedTitle().empty()); |
261 } | 261 } |
262 | 262 |
263 int BookmarkAppBubbleView::TitleStringId() { | 263 int BookmarkAppBubbleView::TitleStringId() { |
264 int string_id = IDS_ADD_TO_DESKTOP_BUBBLE_TITLE; | |
265 #if defined(USE_ASH) | 264 #if defined(USE_ASH) |
266 if (chrome::GetHostDesktopTypeForNativeWindow( | 265 return IDS_ADD_TO_SHELF_BUBBLE_TITLE; |
267 anchor_widget()->GetNativeWindow()) == | 266 #else |
268 chrome::HOST_DESKTOP_TYPE_ASH) { | 267 return IDS_ADD_TO_DESKTOP_BUBBLE_TITLE; |
269 string_id = IDS_ADD_TO_SHELF_BUBBLE_TITLE; | |
270 } | |
271 #endif | 268 #endif |
272 return string_id; | |
273 } | 269 } |
274 | 270 |
275 base::string16 BookmarkAppBubbleView::GetTrimmedTitle() { | 271 base::string16 BookmarkAppBubbleView::GetTrimmedTitle() { |
276 base::string16 title(title_tf_->text()); | 272 base::string16 title(title_tf_->text()); |
277 base::TrimWhitespace(title, base::TRIM_ALL, &title); | 273 base::TrimWhitespace(title, base::TRIM_ALL, &title); |
278 return title; | 274 return title; |
279 } | 275 } |
OLD | NEW |