OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_tabs_module.h" | 5 #include "chrome/browser/extensions/extension_tabs_module.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 } | 471 } |
472 } | 472 } |
473 | 473 |
474 Browser* new_window = Browser::CreateForType(window_type, window_profile); | 474 Browser* new_window = Browser::CreateForType(window_type, window_profile); |
475 for (std::vector<GURL>::iterator i = urls.begin(); i != urls.end(); ++i) | 475 for (std::vector<GURL>::iterator i = urls.begin(); i != urls.end(); ++i) |
476 new_window->AddSelectedTabWithURL(*i, PageTransition::LINK); | 476 new_window->AddSelectedTabWithURL(*i, PageTransition::LINK); |
477 if (contents) { | 477 if (contents) { |
478 TabStripModel* target_tab_strip = new_window->tabstrip_model(); | 478 TabStripModel* target_tab_strip = new_window->tabstrip_model(); |
479 target_tab_strip->InsertTabContentsAt(urls.size(), contents, | 479 target_tab_strip->InsertTabContentsAt(urls.size(), contents, |
480 TabStripModel::ADD_NONE); | 480 TabStripModel::ADD_NONE); |
481 } else if (urls.size() == 0) { | 481 } else if (urls.empty()) { |
482 new_window->NewTab(); | 482 new_window->NewTab(); |
483 } | 483 } |
484 new_window->SelectNumberedTab(0); | 484 new_window->SelectNumberedTab(0); |
485 if (window_type & Browser::TYPE_POPUP) | 485 if (window_type & Browser::TYPE_POPUP) |
486 new_window->window()->SetBounds(popup_bounds); | 486 new_window->window()->SetBounds(popup_bounds); |
487 else | 487 else |
488 new_window->window()->SetBounds(window_bounds); | 488 new_window->window()->SetBounds(window_bounds); |
489 new_window->window()->Show(); | 489 new_window->window()->Show(); |
490 | 490 |
491 if (new_window->profile()->IsOffTheRecord() && !include_incognito()) { | 491 if (new_window->profile()->IsOffTheRecord() && !include_incognito()) { |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 } | 1281 } |
1282 | 1282 |
1283 static GURL ResolvePossiblyRelativeURL(std::string url_string, | 1283 static GURL ResolvePossiblyRelativeURL(std::string url_string, |
1284 const Extension* extension) { | 1284 const Extension* extension) { |
1285 GURL url = GURL(url_string); | 1285 GURL url = GURL(url_string); |
1286 if (!url.is_valid()) | 1286 if (!url.is_valid()) |
1287 url = extension->GetResourceURL(url_string); | 1287 url = extension->GetResourceURL(url_string); |
1288 | 1288 |
1289 return url; | 1289 return url; |
1290 } | 1290 } |
OLD | NEW |