| 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/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 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 if (web_contents->ShowingInterstitialPage()) { | 1547 if (web_contents->ShowingInterstitialPage()) { |
| 1548 // This does as same as Browser::ReloadInternal. | 1548 // This does as same as Browser::ReloadInternal. |
| 1549 NavigationEntry* entry = web_contents->GetController().GetVisibleEntry(); | 1549 NavigationEntry* entry = web_contents->GetController().GetVisibleEntry(); |
| 1550 GURL reload_url = entry ? entry->GetURL() : GURL(url::kAboutBlankURL); | 1550 GURL reload_url = entry ? entry->GetURL() : GURL(url::kAboutBlankURL); |
| 1551 OpenURLParams params(reload_url, Referrer(), | 1551 OpenURLParams params(reload_url, Referrer(), |
| 1552 WindowOpenDisposition::CURRENT_TAB, | 1552 WindowOpenDisposition::CURRENT_TAB, |
| 1553 ui::PAGE_TRANSITION_RELOAD, false); | 1553 ui::PAGE_TRANSITION_RELOAD, false); |
| 1554 current_browser->OpenURL(params); | 1554 current_browser->OpenURL(params); |
| 1555 } else if (bypass_cache) { | |
| 1556 web_contents->GetController().ReloadBypassingCache(true); | |
| 1557 } else { | 1555 } else { |
| 1558 web_contents->GetController().Reload(true); | 1556 web_contents->GetController().Reload( |
| 1557 bypass_cache ? content::ReloadType::BYPASSING_CACHE |
| 1558 : content::ReloadType::NORMAL, |
| 1559 true); |
| 1559 } | 1560 } |
| 1560 | 1561 |
| 1561 return RespondNow(NoArguments()); | 1562 return RespondNow(NoArguments()); |
| 1562 } | 1563 } |
| 1563 | 1564 |
| 1564 ExtensionFunction::ResponseAction TabsRemoveFunction::Run() { | 1565 ExtensionFunction::ResponseAction TabsRemoveFunction::Run() { |
| 1565 std::unique_ptr<tabs::Remove::Params> params( | 1566 std::unique_ptr<tabs::Remove::Params> params( |
| 1566 tabs::Remove::Params::Create(*args_)); | 1567 tabs::Remove::Params::Create(*args_)); |
| 1567 EXTENSION_FUNCTION_VALIDATE(params.get()); | 1568 EXTENSION_FUNCTION_VALIDATE(params.get()); |
| 1568 | 1569 |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2109 params->tab_id | 2110 params->tab_id |
| 2110 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, | 2111 ? ErrorUtils::FormatErrorMessage(keys::kCannotDiscardTab, |
| 2111 base::IntToString(*params->tab_id)) | 2112 base::IntToString(*params->tab_id)) |
| 2112 : keys::kCannotFindTabToDiscard)); | 2113 : keys::kCannotFindTabToDiscard)); |
| 2113 } | 2114 } |
| 2114 | 2115 |
| 2115 TabsDiscardFunction::TabsDiscardFunction() {} | 2116 TabsDiscardFunction::TabsDiscardFunction() {} |
| 2116 TabsDiscardFunction::~TabsDiscardFunction() {} | 2117 TabsDiscardFunction::~TabsDiscardFunction() {} |
| 2117 | 2118 |
| 2118 } // namespace extensions | 2119 } // namespace extensions |
| OLD | NEW |