| 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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 const GURL* url = iterator.NextURL(); | 214 const GURL* url = iterator.NextURL(); |
| 215 // When |initial_disposition| is OFF_THE_RECORD, a node which can't be | 215 // When |initial_disposition| is OFF_THE_RECORD, a node which can't be |
| 216 // opened in incognito window, it is detected using |browser_context|, is | 216 // opened in incognito window, it is detected using |browser_context|, is |
| 217 // not opened. | 217 // not opened. |
| 218 if (initial_disposition == OFF_THE_RECORD && | 218 if (initial_disposition == OFF_THE_RECORD && |
| 219 !IsURLAllowedInIncognito(*url, browser_context)) | 219 !IsURLAllowedInIncognito(*url, browser_context)) |
| 220 continue; | 220 continue; |
| 221 | 221 |
| 222 content::WebContents* opened_tab = navigator->OpenURL( | 222 content::WebContents* opened_tab = navigator->OpenURL( |
| 223 content::OpenURLParams(*url, content::Referrer(), disposition, | 223 content::OpenURLParams(*url, content::Referrer(), disposition, |
| 224 content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); | 224 ui::PAGE_TRANSITION_AUTO_BOOKMARK, false)); |
| 225 | 225 |
| 226 if (!opened_first_url) { | 226 if (!opened_first_url) { |
| 227 opened_first_url = true; | 227 opened_first_url = true; |
| 228 disposition = NEW_BACKGROUND_TAB; | 228 disposition = NEW_BACKGROUND_TAB; |
| 229 // We opened the first URL which may have opened a new window or clobbered | 229 // We opened the first URL which may have opened a new window or clobbered |
| 230 // the current page, reset the navigator just to be sure. |opened_tab| may | 230 // the current page, reset the navigator just to be sure. |opened_tab| may |
| 231 // be NULL in tests. | 231 // be NULL in tests. |
| 232 if (opened_tab) | 232 if (opened_tab) |
| 233 navigator = opened_tab; | 233 navigator = opened_tab; |
| 234 } | 234 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 ++i) { | 367 ++i) { |
| 368 if (extensions::CommandService::RemovesBookmarkOpenPagesShortcut(i->get())) | 368 if (extensions::CommandService::RemovesBookmarkOpenPagesShortcut(i->get())) |
| 369 return true; | 369 return true; |
| 370 } | 370 } |
| 371 #endif | 371 #endif |
| 372 | 372 |
| 373 return false; | 373 return false; |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace chrome | 376 } // namespace chrome |
| OLD | NEW |