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

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

Issue 562603002: Move PageTransition from //content/public/common to //ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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 <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
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
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/ash_panel_contents.cc ('k') | chrome/browser/extensions/api/tabs/tabs_interactive_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698