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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 window_profile, | 552 window_profile, |
553 host_desktop_type); | 553 host_desktop_type); |
554 } | 554 } |
555 create_params.initial_show_state = ui::SHOW_STATE_NORMAL; | 555 create_params.initial_show_state = ui::SHOW_STATE_NORMAL; |
556 create_params.host_desktop_type = chrome::GetActiveDesktop(); | 556 create_params.host_desktop_type = chrome::GetActiveDesktop(); |
557 | 557 |
558 Browser* new_window = new Browser(create_params); | 558 Browser* new_window = new Browser(create_params); |
559 | 559 |
560 for (std::vector<GURL>::iterator i = urls.begin(); i != urls.end(); ++i) { | 560 for (std::vector<GURL>::iterator i = urls.begin(); i != urls.end(); ++i) { |
561 WebContents* tab = chrome::AddSelectedTabWithURL( | 561 WebContents* tab = chrome::AddSelectedTabWithURL( |
562 new_window, *i, content::PAGE_TRANSITION_LINK); | 562 new_window, *i, ui::PAGE_TRANSITION_LINK); |
563 if (create_panel) { | 563 if (create_panel) { |
564 TabHelper::FromWebContents(tab)->SetExtensionAppIconById(extension_id); | 564 TabHelper::FromWebContents(tab)->SetExtensionAppIconById(extension_id); |
565 } | 565 } |
566 } | 566 } |
567 | 567 |
568 WebContents* contents = NULL; | 568 WebContents* contents = NULL; |
569 // Move the tab into the created window only if it's an empty popup or it's | 569 // Move the tab into the created window only if it's an empty popup or it's |
570 // a tabbed window. | 570 // a tabbed window. |
571 if ((window_type == Browser::TYPE_POPUP && urls.empty()) || | 571 if ((window_type == Browser::TYPE_POPUP && urls.empty()) || |
572 window_type == Browser::TYPE_TABBED) { | 572 window_type == Browser::TYPE_TABBED) { |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 GURL(), | 1243 GURL(), |
1244 user_gesture_, | 1244 user_gesture_, |
1245 ScriptExecutor::NO_RESULT, | 1245 ScriptExecutor::NO_RESULT, |
1246 base::Bind(&TabsUpdateFunction::OnExecuteCodeFinished, this)); | 1246 base::Bind(&TabsUpdateFunction::OnExecuteCodeFinished, this)); |
1247 | 1247 |
1248 *is_async = true; | 1248 *is_async = true; |
1249 return true; | 1249 return true; |
1250 } | 1250 } |
1251 | 1251 |
1252 web_contents_->GetController().LoadURL( | 1252 web_contents_->GetController().LoadURL( |
1253 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); | 1253 url, content::Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
1254 | 1254 |
1255 // The URL of a tab contents never actually changes to a JavaScript URL, so | 1255 // The URL of a tab contents never actually changes to a JavaScript URL, so |
1256 // this check only makes sense in other cases. | 1256 // this check only makes sense in other cases. |
1257 if (!url.SchemeIs(url::kJavaScriptScheme)) | 1257 if (!url.SchemeIs(url::kJavaScriptScheme)) |
1258 DCHECK_EQ(url.spec(), web_contents_->GetURL().spec()); | 1258 DCHECK_EQ(url.spec(), web_contents_->GetURL().spec()); |
1259 | 1259 |
1260 return true; | 1260 return true; |
1261 } | 1261 } |
1262 | 1262 |
1263 void TabsUpdateFunction::PopulateResult() { | 1263 void TabsUpdateFunction::PopulateResult() { |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 NULL, | 1459 NULL, |
1460 &error_)) { | 1460 &error_)) { |
1461 return false; | 1461 return false; |
1462 } | 1462 } |
1463 } | 1463 } |
1464 | 1464 |
1465 if (web_contents->ShowingInterstitialPage()) { | 1465 if (web_contents->ShowingInterstitialPage()) { |
1466 // This does as same as Browser::ReloadInternal. | 1466 // This does as same as Browser::ReloadInternal. |
1467 NavigationEntry* entry = web_contents->GetController().GetVisibleEntry(); | 1467 NavigationEntry* entry = web_contents->GetController().GetVisibleEntry(); |
1468 OpenURLParams params(entry->GetURL(), Referrer(), CURRENT_TAB, | 1468 OpenURLParams params(entry->GetURL(), Referrer(), CURRENT_TAB, |
1469 content::PAGE_TRANSITION_RELOAD, false); | 1469 ui::PAGE_TRANSITION_RELOAD, false); |
1470 GetCurrentBrowser()->OpenURL(params); | 1470 GetCurrentBrowser()->OpenURL(params); |
1471 } else if (bypass_cache) { | 1471 } else if (bypass_cache) { |
1472 web_contents->GetController().ReloadIgnoringCache(true); | 1472 web_contents->GetController().ReloadIgnoringCache(true); |
1473 } else { | 1473 } else { |
1474 web_contents->GetController().Reload(true); | 1474 web_contents->GetController().Reload(true); |
1475 } | 1475 } |
1476 | 1476 |
1477 return true; | 1477 return true; |
1478 } | 1478 } |
1479 | 1479 |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1925 ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); | 1925 ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); |
1926 api::tabs::ZoomSettings zoom_settings; | 1926 api::tabs::ZoomSettings zoom_settings; |
1927 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); | 1927 ZoomModeToZoomSettings(zoom_mode, &zoom_settings); |
1928 | 1928 |
1929 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); | 1929 results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); |
1930 SendResponse(true); | 1930 SendResponse(true); |
1931 return true; | 1931 return true; |
1932 } | 1932 } |
1933 | 1933 |
1934 } // namespace extensions | 1934 } // namespace extensions |
OLD | NEW |