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

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
OLDNEW
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/extensions/api/tabs/tabs_api.h" 5 #include "chrome/browser/extensions/api/tabs/tabs_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 if (create_data && create_data->state) { 631 if (create_data && create_data->state) {
632 create_params.initial_show_state = 632 create_params.initial_show_state =
633 ConvertToWindowShowState(create_data->state); 633 ConvertToWindowShowState(create_data->state);
634 } 634 }
635 635
636 Browser* new_window = new Browser(create_params); 636 Browser* new_window = new Browser(create_params);
637 637
638 for (const GURL& url : urls) { 638 for (const GURL& url : urls) {
639 chrome::NavigateParams navigate_params(new_window, url, 639 chrome::NavigateParams navigate_params(new_window, url,
640 ui::PAGE_TRANSITION_LINK); 640 ui::PAGE_TRANSITION_LINK);
641 navigate_params.disposition = NEW_FOREGROUND_TAB; 641 navigate_params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
642 navigate_params.source_site_instance = 642 navigate_params.source_site_instance =
643 render_frame_host()->GetSiteInstance(); 643 render_frame_host()->GetSiteInstance();
644 chrome::Navigate(&navigate_params); 644 chrome::Navigate(&navigate_params);
645 } 645 }
646 646
647 WebContents* contents = NULL; 647 WebContents* contents = NULL;
648 // Move the tab into the created window only if it's an empty popup or it's 648 // Move the tab into the created window only if it's an empty popup or it's
649 // a tabbed window. 649 // a tabbed window.
650 if ((window_type == Browser::TYPE_POPUP && urls.empty()) || 650 if ((window_type == Browser::TYPE_POPUP && urls.empty()) ||
651 window_type == Browser::TYPE_TABBED) { 651 window_type == Browser::TYPE_TABBED) {
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 NULL, 1590 NULL,
1591 &error_)) { 1591 &error_)) {
1592 return false; 1592 return false;
1593 } 1593 }
1594 } 1594 }
1595 1595
1596 if (web_contents->ShowingInterstitialPage()) { 1596 if (web_contents->ShowingInterstitialPage()) {
1597 // This does as same as Browser::ReloadInternal. 1597 // This does as same as Browser::ReloadInternal.
1598 NavigationEntry* entry = web_contents->GetController().GetVisibleEntry(); 1598 NavigationEntry* entry = web_contents->GetController().GetVisibleEntry();
1599 GURL reload_url = entry ? entry->GetURL() : GURL(url::kAboutBlankURL); 1599 GURL reload_url = entry ? entry->GetURL() : GURL(url::kAboutBlankURL);
1600 OpenURLParams params(reload_url, Referrer(), CURRENT_TAB, 1600 OpenURLParams params(reload_url, Referrer(),
1601 WindowOpenDisposition::CURRENT_TAB,
1601 ui::PAGE_TRANSITION_RELOAD, false); 1602 ui::PAGE_TRANSITION_RELOAD, false);
1602 GetCurrentBrowser()->OpenURL(params); 1603 GetCurrentBrowser()->OpenURL(params);
1603 } else if (bypass_cache) { 1604 } else if (bypass_cache) {
1604 web_contents->GetController().ReloadBypassingCache(true); 1605 web_contents->GetController().ReloadBypassingCache(true);
1605 } else { 1606 } else {
1606 web_contents->GetController().Reload(true); 1607 web_contents->GetController().Reload(true);
1607 } 1608 }
1608 1609
1609 return true; 1610 return true;
1610 } 1611 }
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
2183 params->tab_id 2184 params->tab_id
2184 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, 2185 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab,
2185 base::IntToString(*params->tab_id)) 2186 base::IntToString(*params->tab_id))
2186 : keys::kCannotFindTabToDiscard)); 2187 : keys::kCannotFindTabToDiscard));
2187 } 2188 }
2188 2189
2189 TabsDiscardFunction::TabsDiscardFunction() {} 2190 TabsDiscardFunction::TabsDiscardFunction() {}
2190 TabsDiscardFunction::~TabsDiscardFunction() {} 2191 TabsDiscardFunction::~TabsDiscardFunction() {}
2191 2192
2192 } // namespace extensions 2193 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc ('k') | chrome/browser/extensions/api/tabs/tabs_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698