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

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 6602049: Pure pedantry: Replace all ".size() == 0" with ".empty()". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698