OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2871 | 2871 |
2872 /////////////////////////////////////////////////////////////////////////////// | 2872 /////////////////////////////////////////////////////////////////////////////// |
2873 // Browser, PageNavigator implementation: | 2873 // Browser, PageNavigator implementation: |
2874 | 2874 |
2875 // TODO(adriansc): Remove this method once refactoring changed all call sites. | 2875 // TODO(adriansc): Remove this method once refactoring changed all call sites. |
2876 TabContents* Browser::OpenURL(const GURL& url, | 2876 TabContents* Browser::OpenURL(const GURL& url, |
2877 const GURL& referrer, | 2877 const GURL& referrer, |
2878 WindowOpenDisposition disposition, | 2878 WindowOpenDisposition disposition, |
2879 content::PageTransition transition) { | 2879 content::PageTransition transition) { |
2880 return OpenURLFromTab(NULL, | 2880 return OpenURLFromTab(NULL, |
2881 OpenURLParams(url, referrer, disposition, transition)); | 2881 OpenURLParams(url, referrer, disposition, transition, |
| 2882 false)); |
2882 } | 2883 } |
2883 | 2884 |
2884 TabContents* Browser::OpenURL(const OpenURLParams& params) { | 2885 TabContents* Browser::OpenURL(const OpenURLParams& params) { |
2885 return OpenURLFromTab(NULL, params); | 2886 return OpenURLFromTab(NULL, params); |
2886 } | 2887 } |
2887 | 2888 |
2888 /////////////////////////////////////////////////////////////////////////////// | 2889 /////////////////////////////////////////////////////////////////////////////// |
2889 // Browser, CommandUpdater::CommandUpdaterDelegate implementation: | 2890 // Browser, CommandUpdater::CommandUpdaterDelegate implementation: |
2890 | 2891 |
2891 void Browser::ExecuteCommand(int id) { | 2892 void Browser::ExecuteCommand(int id) { |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3297 /////////////////////////////////////////////////////////////////////////////// | 3298 /////////////////////////////////////////////////////////////////////////////// |
3298 // Browser, TabContentsDelegate implementation: | 3299 // Browser, TabContentsDelegate implementation: |
3299 | 3300 |
3300 // TODO(adriansc): Remove this method once refactoring changed all call sites. | 3301 // TODO(adriansc): Remove this method once refactoring changed all call sites. |
3301 TabContents* Browser::OpenURLFromTab(TabContents* source, | 3302 TabContents* Browser::OpenURLFromTab(TabContents* source, |
3302 const GURL& url, | 3303 const GURL& url, |
3303 const GURL& referrer, | 3304 const GURL& referrer, |
3304 WindowOpenDisposition disposition, | 3305 WindowOpenDisposition disposition, |
3305 content::PageTransition transition) { | 3306 content::PageTransition transition) { |
3306 return OpenURLFromTab(source, OpenURLParams(url, referrer, disposition, | 3307 return OpenURLFromTab(source, OpenURLParams(url, referrer, disposition, |
3307 transition)); | 3308 transition, false)); |
3308 } | 3309 } |
3309 | 3310 |
3310 TabContents* Browser::OpenURLFromTab(TabContents* source, | 3311 TabContents* Browser::OpenURLFromTab(TabContents* source, |
3311 const OpenURLParams& params) { | 3312 const OpenURLParams& params) { |
3312 browser::NavigateParams nav_params(this, params.url, params.transition); | 3313 browser::NavigateParams nav_params(this, params.url, params.transition); |
3313 nav_params.source_contents = | 3314 nav_params.source_contents = |
3314 tabstrip_model()->GetTabContentsAt( | 3315 tabstrip_model()->GetTabContentsAt( |
3315 tabstrip_model()->GetWrapperIndex(source)); | 3316 tabstrip_model()->GetWrapperIndex(source)); |
3316 nav_params.referrer = params.referrer; | 3317 nav_params.referrer = params.referrer; |
3317 nav_params.disposition = params.disposition; | 3318 nav_params.disposition = params.disposition; |
3318 nav_params.tabstrip_add_types = TabStripModel::ADD_NONE; | 3319 nav_params.tabstrip_add_types = TabStripModel::ADD_NONE; |
3319 nav_params.window_action = browser::NavigateParams::SHOW_WINDOW; | 3320 nav_params.window_action = browser::NavigateParams::SHOW_WINDOW; |
3320 nav_params.user_gesture = true; | 3321 nav_params.user_gesture = true; |
3321 nav_params.override_encoding = params.override_encoding; | 3322 nav_params.override_encoding = params.override_encoding; |
| 3323 nav_params.is_renderer_initiated = params.is_renderer_initiated; |
3322 browser::Navigate(&nav_params); | 3324 browser::Navigate(&nav_params); |
3323 | 3325 |
3324 return nav_params.target_contents ? | 3326 return nav_params.target_contents ? |
3325 nav_params.target_contents->tab_contents() : NULL; | 3327 nav_params.target_contents->tab_contents() : NULL; |
3326 } | 3328 } |
3327 | 3329 |
3328 void Browser::NavigationStateChanged(const TabContents* source, | 3330 void Browser::NavigationStateChanged(const TabContents* source, |
3329 unsigned changed_flags) { | 3331 unsigned changed_flags) { |
3330 // Only update the UI when something visible has changed. | 3332 // Only update the UI when something visible has changed. |
3331 if (changed_flags) | 3333 if (changed_flags) |
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5287 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5289 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
5288 } else if (is_type_tabbed()) { | 5290 } else if (is_type_tabbed()) { |
5289 GlobalErrorService* service = | 5291 GlobalErrorService* service = |
5290 GlobalErrorServiceFactory::GetForProfile(profile()); | 5292 GlobalErrorServiceFactory::GetForProfile(profile()); |
5291 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5293 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
5292 if (error) { | 5294 if (error) { |
5293 error->ShowBubbleView(this); | 5295 error->ShowBubbleView(this); |
5294 } | 5296 } |
5295 } | 5297 } |
5296 } | 5298 } |
OLD | NEW |