| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |