Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc

Issue 152843004: Move BookmarkBubble with anchor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move the bubble with anchor Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 edit_button_(NULL), 263 edit_button_(NULL),
264 close_button_(NULL), 264 close_button_(NULL),
265 title_tf_(NULL), 265 title_tf_(NULL),
266 parent_combobox_(NULL), 266 parent_combobox_(NULL),
267 sync_promo_view_(NULL), 267 sync_promo_view_(NULL),
268 remove_bookmark_(false), 268 remove_bookmark_(false),
269 apply_edits_(true) { 269 apply_edits_(true) {
270 const SkColor background_color = GetNativeTheme()->GetSystemColor( 270 const SkColor background_color = GetNativeTheme()->GetSystemColor(
271 ui::NativeTheme::kColorId_DialogBackground); 271 ui::NativeTheme::kColorId_DialogBackground);
272 set_color(background_color); 272 set_color(background_color);
273 set_move_with_anchor(true);
273 set_background(views::Background::CreateSolidBackground(background_color)); 274 set_background(views::Background::CreateSolidBackground(background_color));
274 set_margins(gfx::Insets(views::kPanelVertMargin, 0, 0, 0)); 275 set_margins(gfx::Insets(views::kPanelVertMargin, 0, 0, 0));
275 // Compensate for built-in vertical padding in the anchor view's image. 276 // Compensate for built-in vertical padding in the anchor view's image.
276 set_anchor_view_insets(gfx::Insets(2, 0, 2, 0)); 277 set_anchor_view_insets(gfx::Insets(2, 0, 2, 0));
277 } 278 }
278 279
279 base::string16 BookmarkBubbleView::GetTitle() { 280 base::string16 BookmarkBubbleView::GetTitle() {
280 BookmarkModel* bookmark_model = 281 BookmarkModel* bookmark_model =
281 BookmarkModelFactory::GetForProfile(profile_); 282 BookmarkModelFactory::GetForProfile(profile_);
282 const BookmarkNode* node = 283 const BookmarkNode* node =
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 if (node) { 356 if (node) {
356 const base::string16 new_title = title_tf_->text(); 357 const base::string16 new_title = title_tf_->text();
357 if (new_title != node->GetTitle()) { 358 if (new_title != node->GetTitle()) {
358 model->SetTitle(node, new_title); 359 model->SetTitle(node, new_title);
359 content::RecordAction( 360 content::RecordAction(
360 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); 361 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"));
361 } 362 }
362 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); 363 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index());
363 } 364 }
364 } 365 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698