| 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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 10 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 if (!ShouldOpenAll(parent, nodes)) | 311 if (!ShouldOpenAll(parent, nodes)) |
| 312 return; | 312 return; |
| 313 | 313 |
| 314 NewBrowserPageNavigator navigator_impl(profile); | 314 NewBrowserPageNavigator navigator_impl(profile); |
| 315 if (!navigator) { | 315 if (!navigator) { |
| 316 Browser* browser = | 316 Browser* browser = |
| 317 BrowserList::FindBrowserWithType(profile, Browser::TYPE_NORMAL); | 317 BrowserList::FindBrowserWithType(profile, Browser::TYPE_NORMAL); |
| 318 if (!browser || !browser->GetSelectedTabContents()) { | 318 if (!browser || !browser->GetSelectedTabContents()) { |
| 319 navigator = &navigator_impl; | 319 navigator = &navigator_impl; |
| 320 } else { | 320 } else { |
| 321 browser->window()->Activate(); | 321 if (initial_disposition != NEW_WINDOW && |
| 322 initial_disposition != OFF_THE_RECORD) { |
| 323 browser->window()->Activate(); |
| 324 } |
| 322 navigator = browser->GetSelectedTabContents(); | 325 navigator = browser->GetSelectedTabContents(); |
| 323 } | 326 } |
| 324 } | 327 } |
| 325 | 328 |
| 326 bool opened_url = false; | 329 bool opened_url = false; |
| 327 for (size_t i = 0; i < nodes.size(); ++i) | 330 for (size_t i = 0; i < nodes.size(); ++i) |
| 328 OpenAllImpl(nodes[i], initial_disposition, &navigator, &opened_url); | 331 OpenAllImpl(nodes[i], initial_disposition, &navigator, &opened_url); |
| 329 } | 332 } |
| 330 | 333 |
| 331 void OpenAll(gfx::NativeWindow parent, | 334 void OpenAll(gfx::NativeWindow parent, |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 std::vector<std::wstring> words; | 523 std::vector<std::wstring> words; |
| 521 QueryParser parser; | 524 QueryParser parser; |
| 522 parser.ExtractQueryWords(l10n_util::ToLower(text), &words); | 525 parser.ExtractQueryWords(l10n_util::ToLower(text), &words); |
| 523 if (words.empty()) | 526 if (words.empty()) |
| 524 return false; | 527 return false; |
| 525 | 528 |
| 526 return (node->is_url() && DoesBookmarkContainWords(node, words)); | 529 return (node->is_url() && DoesBookmarkContainWords(node, words)); |
| 527 } | 530 } |
| 528 | 531 |
| 529 } // namespace bookmark_utils | 532 } // namespace bookmark_utils |
| OLD | NEW |