| 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | 123 #include "chrome/browser/ui/media_stream_infobar_delegate.h" |
| 124 #include "chrome/browser/ui/omnibox/location_bar.h" | 124 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 125 #include "chrome/browser/ui/search/search.h" | 125 #include "chrome/browser/ui/search/search.h" |
| 126 #include "chrome/browser/ui/search/search_delegate.h" | 126 #include "chrome/browser/ui/search/search_delegate.h" |
| 127 #include "chrome/browser/ui/search/search_model.h" | 127 #include "chrome/browser/ui/search/search_model.h" |
| 128 #include "chrome/browser/ui/singleton_tabs.h" | 128 #include "chrome/browser/ui/singleton_tabs.h" |
| 129 #include "chrome/browser/ui/status_bubble.h" | 129 #include "chrome/browser/ui/status_bubble.h" |
| 130 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" | 130 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" |
| 131 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 131 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 132 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 132 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 133 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" |
| 133 #include "chrome/browser/ui/tabs/dock_info.h" | 134 #include "chrome/browser/ui/tabs/dock_info.h" |
| 134 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 135 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 135 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 136 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 136 #include "chrome/browser/ui/unload_controller.h" | 137 #include "chrome/browser/ui/unload_controller.h" |
| 137 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 138 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
| 138 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 139 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 139 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 140 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 140 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 141 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 141 #include "chrome/browser/upgrade_detector.h" | 142 #include "chrome/browser/upgrade_detector.h" |
| 142 #include "chrome/browser/web_applications/web_app.h" | 143 #include "chrome/browser/web_applications/web_app.h" |
| (...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 void Browser::ViewSourceForFrame(WebContents* source, | 1468 void Browser::ViewSourceForFrame(WebContents* source, |
| 1468 const GURL& frame_url, | 1469 const GURL& frame_url, |
| 1469 const std::string& frame_content_state) { | 1470 const std::string& frame_content_state) { |
| 1470 DCHECK(source); | 1471 DCHECK(source); |
| 1471 TabContents* tab_contents = chrome::GetTabContentsAt(this, | 1472 TabContents* tab_contents = chrome::GetTabContentsAt(this, |
| 1472 tab_strip_model_->GetIndexOfWebContents(source)); | 1473 tab_strip_model_->GetIndexOfWebContents(source)); |
| 1473 chrome::ViewSource(this, tab_contents, frame_url, frame_content_state); | 1474 chrome::ViewSource(this, tab_contents, frame_url, frame_content_state); |
| 1474 } | 1475 } |
| 1475 | 1476 |
| 1476 void Browser::ShowRepostFormWarningDialog(WebContents* source) { | 1477 void Browser::ShowRepostFormWarningDialog(WebContents* source) { |
| 1477 chrome::ShowTabModalConfirmDialog(new RepostFormWarningController(source), | 1478 TabModalConfirmDialog::Create(new RepostFormWarningController(source), |
| 1478 TabContents::FromWebContents(source)); | 1479 TabContents::FromWebContents(source)); |
| 1479 } | 1480 } |
| 1480 | 1481 |
| 1481 bool Browser::ShouldAddNavigationToHistory( | 1482 bool Browser::ShouldAddNavigationToHistory( |
| 1482 const history::HistoryAddPageArgs& add_page_args, | 1483 const history::HistoryAddPageArgs& add_page_args, |
| 1483 content::NavigationType navigation_type) { | 1484 content::NavigationType navigation_type) { |
| 1484 // Don't update history if running as app. | 1485 // Don't update history if running as app. |
| 1485 return !IsApplication(); | 1486 return !IsApplication(); |
| 1486 } | 1487 } |
| 1487 | 1488 |
| 1488 bool Browser::ShouldCreateWebContents( | 1489 bool Browser::ShouldCreateWebContents( |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2291 if (contents && !allow_js_access) { | 2292 if (contents && !allow_js_access) { |
| 2292 contents->web_contents()->GetController().LoadURL( | 2293 contents->web_contents()->GetController().LoadURL( |
| 2293 target_url, | 2294 target_url, |
| 2294 content::Referrer(), | 2295 content::Referrer(), |
| 2295 content::PAGE_TRANSITION_LINK, | 2296 content::PAGE_TRANSITION_LINK, |
| 2296 std::string()); // No extra headers. | 2297 std::string()); // No extra headers. |
| 2297 } | 2298 } |
| 2298 | 2299 |
| 2299 return contents != NULL; | 2300 return contents != NULL; |
| 2300 } | 2301 } |
| OLD | NEW |