| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bookmarks/bookmark_bubble_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 BookmarkModelFactory::GetForProfile(profile_); | 285 BookmarkModelFactory::GetForProfile(profile_); |
| 286 const BookmarkNode* node = | 286 const BookmarkNode* node = |
| 287 bookmark_model->GetMostRecentlyAddedNodeForURL(url_); | 287 bookmark_model->GetMostRecentlyAddedNodeForURL(url_); |
| 288 if (node) | 288 if (node) |
| 289 return node->GetTitle(); | 289 return node->GetTitle(); |
| 290 else | 290 else |
| 291 NOTREACHED(); | 291 NOTREACHED(); |
| 292 return base::string16(); | 292 return base::string16(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 gfx::Size BookmarkBubbleView::GetMinimumSize() { | 295 gfx::Size BookmarkBubbleView::GetMinimumSize() const { |
| 296 gfx::Size size(views::BubbleDelegateView::GetPreferredSize()); | 296 gfx::Size size(views::BubbleDelegateView::GetPreferredSize()); |
| 297 size.SetToMax(gfx::Size(kMinBubbleWidth, 0)); | 297 size.SetToMax(gfx::Size(kMinBubbleWidth, 0)); |
| 298 return size; | 298 return size; |
| 299 } | 299 } |
| 300 | 300 |
| 301 void BookmarkBubbleView::GetAccessibleState(ui::AXViewState* state) { | 301 void BookmarkBubbleView::GetAccessibleState(ui::AXViewState* state) { |
| 302 BubbleDelegateView::GetAccessibleState(state); | 302 BubbleDelegateView::GetAccessibleState(state); |
| 303 state->name = | 303 state->name = |
| 304 l10n_util::GetStringUTF16( | 304 l10n_util::GetStringUTF16( |
| 305 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : | 305 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 if (node) { | 359 if (node) { |
| 360 const base::string16 new_title = title_tf_->text(); | 360 const base::string16 new_title = title_tf_->text(); |
| 361 if (new_title != node->GetTitle()) { | 361 if (new_title != node->GetTitle()) { |
| 362 model->SetTitle(node, new_title); | 362 model->SetTitle(node, new_title); |
| 363 content::RecordAction( | 363 content::RecordAction( |
| 364 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 364 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
| 365 } | 365 } |
| 366 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); | 366 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); |
| 367 } | 367 } |
| 368 } | 368 } |
| OLD | NEW |