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

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

Issue 3093: Fixed bookmark bubble bug. If you changed the title, then clicked edit... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/bookmark_bubble_view.h" 5 #include "chrome/browser/views/bookmark_bubble_view.h"
6 6
7 #include "chrome/app/chrome_dll_resource.h" 7 #include "chrome/app/chrome_dll_resource.h"
8 #include "chrome/app/theme/theme_resources.h" 8 #include "chrome/app/theme/theme_resources.h"
9 #include "chrome/browser/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 // Close first, then notify the service. That way we know we won't be 324 // Close first, then notify the service. That way we know we won't be
325 // visible and don't have to worry about some other window becoming 325 // visible and don't have to worry about some other window becoming
326 // activated and deleting us before we invoke Close. 326 // activated and deleting us before we invoke Close.
327 Close(); 327 Close();
328 // WARNING: we've likely been deleted. 328 // WARNING: we've likely been deleted.
329 if (model) 329 if (model)
330 model->SetURLStarred(url, std::wstring(), false); 330 model->SetURLStarred(url, std::wstring(), false);
331 } 331 }
332 332
333 void BookmarkBubbleView::ShowEditor() { 333 void BookmarkBubbleView::ShowEditor() {
334 // The user may have edited the title, commit it now.
335 SetNodeTitleFromTextField();
336
334 // Parent the editor to our root ancestor (not the root we're in, as that 337 // Parent the editor to our root ancestor (not the root we're in, as that
335 // is the info bubble and will close shortly). 338 // is the info bubble and will close shortly).
336 HWND parent = GetAncestor(GetViewContainer()->GetHWND(), GA_ROOTOWNER); 339 HWND parent = GetAncestor(GetViewContainer()->GetHWND(), GA_ROOTOWNER);
337 340
338 // We're about to show the bookmark editor. When the bookmark editor closes 341 // We're about to show the bookmark editor. When the bookmark editor closes
339 // we want the browser to become active. HWNDViewContainer::Hide() does a 342 // we want the browser to become active. HWNDViewContainer::Hide() does a
340 // hide in a such way that activation isn't changed, which means when we 343 // hide in a such way that activation isn't changed, which means when we
341 // close Windows gets confused as to who it should give active status to. 344 // close Windows gets confused as to who it should give active status to.
342 // We explicitly hide the bookmark bubble window in such a way that 345 // We explicitly hide the bookmark bubble window in such a way that
343 // activation status changes. That way, when the editor closes, activation 346 // activation status changes. That way, when the editor closes, activation
(...skipping 12 matching lines...) Expand all
356 BookmarkNode* node = model->GetNodeByURL(url_); 359 BookmarkNode* node = model->GetNodeByURL(url_);
357 if (node) { 360 if (node) {
358 const std::wstring new_title = title_tf_->GetText(); 361 const std::wstring new_title = title_tf_->GetText();
359 if (new_title != node->GetTitle()) { 362 if (new_title != node->GetTitle()) {
360 model->SetTitle(node, new_title); 363 model->SetTitle(node, new_title);
361 UserMetrics::RecordAction(L"BookmarkBubble_ChangeTitleInBubble", 364 UserMetrics::RecordAction(L"BookmarkBubble_ChangeTitleInBubble",
362 profile_); 365 profile_);
363 } 366 }
364 } 367 }
365 } 368 }
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