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/views/external_tab_container_win.h" | 5 #include "chrome/browser/ui/views/external_tab_container_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 } | 545 } |
546 uintptr_t cookie = reinterpret_cast<uintptr_t>(new_container.get()); | 546 uintptr_t cookie = reinterpret_cast<uintptr_t>(new_container.get()); |
547 pending_tabs_.Get()[cookie] = new_container; | 547 pending_tabs_.Get()[cookie] = new_container; |
548 new_container->set_pending(true); | 548 new_container->set_pending(true); |
549 new_container->set_is_popup_window(disposition == NEW_POPUP); | 549 new_container->set_is_popup_window(disposition == NEW_POPUP); |
550 AttachExternalTabParams attach_params_; | 550 AttachExternalTabParams attach_params_; |
551 attach_params_.cookie = static_cast<uint64>(cookie); | 551 attach_params_.cookie = static_cast<uint64>(cookie); |
552 attach_params_.dimensions = initial_pos; | 552 attach_params_.dimensions = initial_pos; |
553 attach_params_.user_gesture = user_gesture; | 553 attach_params_.user_gesture = user_gesture; |
554 attach_params_.disposition = disposition; | 554 attach_params_.disposition = disposition; |
555 attach_params_.profile_name = WideToUTF8( | 555 attach_params_.profile_name = base::WideToUTF8( |
556 profile->GetPath().DirName().BaseName().value()); | 556 profile->GetPath().DirName().BaseName().value()); |
557 automation_->Send(new AutomationMsg_AttachExternalTab( | 557 automation_->Send(new AutomationMsg_AttachExternalTab( |
558 tab_handle_, attach_params_)); | 558 tab_handle_, attach_params_)); |
559 } else { | 559 } else { |
560 NOTREACHED(); | 560 NOTREACHED(); |
561 } | 561 } |
562 } | 562 } |
563 | 563 |
564 void ExternalTabContainerWin::WebContentsCreated(WebContents* source_contents, | 564 void ExternalTabContainerWin::WebContentsCreated(WebContents* source_contents, |
565 int64 source_frame_id, | 565 int64 source_frame_id, |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 // If this is very early in the game then there may not be an entry. | 1013 // If this is very early in the game then there may not be an entry. |
1014 if (!entry) | 1014 if (!entry) |
1015 return false; | 1015 return false; |
1016 | 1016 |
1017 nav_info->navigation_type = nav_type; | 1017 nav_info->navigation_type = nav_type; |
1018 nav_info->relative_offset = relative_offset; | 1018 nav_info->relative_offset = relative_offset; |
1019 nav_info->navigation_index = | 1019 nav_info->navigation_index = |
1020 web_contents_->GetController().GetCurrentEntryIndex(); | 1020 web_contents_->GetController().GetCurrentEntryIndex(); |
1021 nav_info->url = entry->GetURL(); | 1021 nav_info->url = entry->GetURL(); |
1022 nav_info->referrer = entry->GetReferrer().url; | 1022 nav_info->referrer = entry->GetReferrer().url; |
1023 nav_info->title = UTF16ToWideHack(entry->GetTitle()); | 1023 nav_info->title = base::UTF16ToWideHack(entry->GetTitle()); |
1024 if (nav_info->title.empty()) | 1024 if (nav_info->title.empty()) |
1025 nav_info->title = UTF8ToWide(nav_info->url.spec()); | 1025 nav_info->title = base::UTF8ToWide(nav_info->url.spec()); |
1026 | 1026 |
1027 nav_info->security_style = entry->GetSSL().security_style; | 1027 nav_info->security_style = entry->GetSSL().security_style; |
1028 int content_status = entry->GetSSL().content_status; | 1028 int content_status = entry->GetSSL().content_status; |
1029 nav_info->displayed_insecure_content = | 1029 nav_info->displayed_insecure_content = |
1030 !!(content_status & SSLStatus::DISPLAYED_INSECURE_CONTENT); | 1030 !!(content_status & SSLStatus::DISPLAYED_INSECURE_CONTENT); |
1031 nav_info->ran_insecure_content = | 1031 nav_info->ran_insecure_content = |
1032 !!(content_status & SSLStatus::RAN_INSECURE_CONTENT); | 1032 !!(content_status & SSLStatus::RAN_INSECURE_CONTENT); |
1033 return true; | 1033 return true; |
1034 } | 1034 } |
1035 | 1035 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 if (params.disposition == CURRENT_TAB) { | 1278 if (params.disposition == CURRENT_TAB) { |
1279 DCHECK(route_all_top_level_navigations_); | 1279 DCHECK(route_all_top_level_navigations_); |
1280 forward_params.disposition = NEW_FOREGROUND_TAB; | 1280 forward_params.disposition = NEW_FOREGROUND_TAB; |
1281 } | 1281 } |
1282 WebContents* new_contents = | 1282 WebContents* new_contents = |
1283 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); | 1283 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); |
1284 // support only one navigation for a dummy tab before it is killed. | 1284 // support only one navigation for a dummy tab before it is killed. |
1285 ::DestroyWindow(GetNativeView()); | 1285 ::DestroyWindow(GetNativeView()); |
1286 return new_contents; | 1286 return new_contents; |
1287 } | 1287 } |
OLD | NEW |