Chromium Code Reviews| 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 2677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2688 GetStatusBubble()->Hide(); | 2688 GetStatusBubble()->Hide(); |
| 2689 | 2689 |
| 2690 // Update the location bar. This is synchronous. We specifically don't | 2690 // Update the location bar. This is synchronous. We specifically don't |
| 2691 // update the load state since the load hasn't started yet and updating it | 2691 // update the load state since the load hasn't started yet and updating it |
| 2692 // will put it out of sync with the actual state like whether we're | 2692 // will put it out of sync with the actual state like whether we're |
| 2693 // displaying a favicon, which controls the throbber. If we updated it here, | 2693 // displaying a favicon, which controls the throbber. If we updated it here, |
| 2694 // the throbber will show the default favicon for a split second when | 2694 // the throbber will show the default favicon for a split second when |
| 2695 // navigating away from the new tab page. | 2695 // navigating away from the new tab page. |
| 2696 ScheduleUIUpdate(contents->web_contents(), content::INVALIDATE_TYPE_URL); | 2696 ScheduleUIUpdate(contents->web_contents(), content::INVALIDATE_TYPE_URL); |
| 2697 | 2697 |
| 2698 #if defined(USE_ASH) | |
| 2699 // When using ash it is not desirable to switch to a new window when the | |
|
sky
2012/05/18 19:43:30
Why is this specific to ash? Additionally I'm not
Mr4D (OOO till 08-26)
2012/05/18 20:27:01
user_initiated:
the problem is that if the page r
| |
| 2700 // page refresh wasn't initiated by the user (but instead by a page refresh). | |
| 2701 if (!user_initiated) | |
| 2702 return; | |
| 2703 #endif | |
| 2704 | |
| 2698 if (contents_is_selected) | 2705 if (contents_is_selected) |
| 2699 contents->web_contents()->Focus(); | 2706 contents->web_contents()->Focus(); |
| 2700 } | 2707 } |
| 2701 | 2708 |
| 2702 void Browser::ShowCollectedCookiesDialog(TabContentsWrapper* wrapper) { | 2709 void Browser::ShowCollectedCookiesDialog(TabContentsWrapper* wrapper) { |
| 2703 browser::ShowCollectedCookiesDialog(window()->GetNativeHandle(), wrapper); | 2710 browser::ShowCollectedCookiesDialog(window()->GetNativeHandle(), wrapper); |
| 2704 } | 2711 } |
| 2705 | 2712 |
| 2706 /////////////////////////////////////////////////////////////////////////////// | 2713 /////////////////////////////////////////////////////////////////////////////// |
| 2707 // Browser, PageNavigator implementation: | 2714 // Browser, PageNavigator implementation: |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3402 // Browser, content::WebContentsDelegate implementation: | 3409 // Browser, content::WebContentsDelegate implementation: |
| 3403 | 3410 |
| 3404 WebContents* Browser::OpenURLFromTab(WebContents* source, | 3411 WebContents* Browser::OpenURLFromTab(WebContents* source, |
| 3405 const OpenURLParams& params) { | 3412 const OpenURLParams& params) { |
| 3406 browser::NavigateParams nav_params(this, params.url, params.transition); | 3413 browser::NavigateParams nav_params(this, params.url, params.transition); |
| 3407 nav_params.source_contents = GetTabContentsWrapperAt( | 3414 nav_params.source_contents = GetTabContentsWrapperAt( |
| 3408 tab_strip_model_->GetWrapperIndex(source)); | 3415 tab_strip_model_->GetWrapperIndex(source)); |
| 3409 nav_params.referrer = params.referrer; | 3416 nav_params.referrer = params.referrer; |
| 3410 nav_params.disposition = params.disposition; | 3417 nav_params.disposition = params.disposition; |
| 3411 nav_params.tabstrip_add_types = TabStripModel::ADD_NONE; | 3418 nav_params.tabstrip_add_types = TabStripModel::ADD_NONE; |
| 3412 nav_params.window_action = browser::NavigateParams::SHOW_WINDOW; | 3419 #if defined(USE_ASH) |
|
sky
2012/05/18 19:43:30
Whats the motivation for this?
Mr4D (OOO till 08-26)
2012/05/18 20:27:01
When this flag gets set, the LoadURL call further
| |
| 3420 // If the current tab is initiating this, we don't want to update. | |
| 3421 if (nav_params.window_action != browser::NavigateParams::NO_ACTION || | |
| 3422 params.disposition != CURRENT_TAB) | |
| 3423 #endif | |
| 3424 nav_params.window_action = browser::NavigateParams::SHOW_WINDOW; | |
| 3413 nav_params.user_gesture = true; | 3425 nav_params.user_gesture = true; |
| 3414 nav_params.override_encoding = params.override_encoding; | 3426 nav_params.override_encoding = params.override_encoding; |
| 3415 nav_params.is_renderer_initiated = params.is_renderer_initiated; | 3427 nav_params.is_renderer_initiated = params.is_renderer_initiated; |
| 3416 nav_params.transferred_global_request_id = | 3428 nav_params.transferred_global_request_id = |
| 3417 params.transferred_global_request_id; | 3429 params.transferred_global_request_id; |
| 3418 browser::Navigate(&nav_params); | 3430 browser::Navigate(&nav_params); |
| 3419 | 3431 |
| 3420 return nav_params.target_contents ? | 3432 return nav_params.target_contents ? |
| 3421 nav_params.target_contents->web_contents() : NULL; | 3433 nav_params.target_contents->web_contents() : NULL; |
| 3422 } | 3434 } |
| (...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5424 if (contents && !allow_js_access) { | 5436 if (contents && !allow_js_access) { |
| 5425 contents->web_contents()->GetController().LoadURL( | 5437 contents->web_contents()->GetController().LoadURL( |
| 5426 target_url, | 5438 target_url, |
| 5427 content::Referrer(), | 5439 content::Referrer(), |
| 5428 content::PAGE_TRANSITION_LINK, | 5440 content::PAGE_TRANSITION_LINK, |
| 5429 std::string()); // No extra headers. | 5441 std::string()); // No extra headers. |
| 5430 } | 5442 } |
| 5431 | 5443 |
| 5432 return contents != NULL; | 5444 return contents != NULL; |
| 5433 } | 5445 } |
| OLD | NEW |