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/external_tab_container_win.h" | 5 #include "chrome/browser/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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 60 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
61 #include "third_party/WebKit/Source/WebKit/chromium/public/WebReferrerPolicy.h" | 61 #include "third_party/WebKit/Source/WebKit/chromium/public/WebReferrerPolicy.h" |
62 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 62 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
63 #include "ui/base/l10n/l10n_util.h" | 63 #include "ui/base/l10n/l10n_util.h" |
64 #include "ui/base/models/menu_model.h" | 64 #include "ui/base/models/menu_model.h" |
65 #include "ui/base/resource/resource_bundle.h" | 65 #include "ui/base/resource/resource_bundle.h" |
66 #include "ui/base/view_prop.h" | 66 #include "ui/base/view_prop.h" |
67 #include "ui/views/layout/grid_layout.h" | 67 #include "ui/views/layout/grid_layout.h" |
68 | 68 |
69 using content::BrowserThread; | 69 using content::BrowserThread; |
| 70 using content::NavigationEntry; |
70 using content::OpenURLParams; | 71 using content::OpenURLParams; |
71 using content::SSLStatus; | 72 using content::SSLStatus; |
72 using content::WebContents; | 73 using content::WebContents; |
73 using ui::ViewProp; | 74 using ui::ViewProp; |
74 using WebKit::WebCString; | 75 using WebKit::WebCString; |
75 using WebKit::WebString; | 76 using WebKit::WebString; |
76 using WebKit::WebReferrerPolicy; | 77 using WebKit::WebReferrerPolicy; |
77 using WebKit::WebSecurityPolicy; | 78 using WebKit::WebSecurityPolicy; |
78 | 79 |
79 static const char kWindowObjectKey[] = "ChromeWindowObject"; | 80 static const char kWindowObjectKey[] = "ChromeWindowObject"; |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 msg.wParam = wparam; | 950 msg.wParam = wparam; |
950 msg.lParam = lparam; | 951 msg.lParam = lparam; |
951 automation_->Send(new AutomationMsg_HandleAccelerator(tab_handle_, msg)); | 952 automation_->Send(new AutomationMsg_HandleAccelerator(tab_handle_, msg)); |
952 return true; | 953 return true; |
953 } | 954 } |
954 | 955 |
955 bool ExternalTabContainer::InitNavigationInfo(NavigationInfo* nav_info, | 956 bool ExternalTabContainer::InitNavigationInfo(NavigationInfo* nav_info, |
956 content::NavigationType nav_type, | 957 content::NavigationType nav_type, |
957 int relative_offset) { | 958 int relative_offset) { |
958 DCHECK(nav_info); | 959 DCHECK(nav_info); |
959 content::NavigationEntry* entry = | 960 NavigationEntry* entry = |
960 tab_contents_->tab_contents()->GetController().GetActiveEntry(); | 961 tab_contents_->tab_contents()->GetController().GetActiveEntry(); |
961 // If this is very early in the game then we may not have an entry. | 962 // If this is very early in the game then we may not have an entry. |
962 if (!entry) | 963 if (!entry) |
963 return false; | 964 return false; |
964 | 965 |
965 nav_info->navigation_type = nav_type; | 966 nav_info->navigation_type = nav_type; |
966 nav_info->relative_offset = relative_offset; | 967 nav_info->relative_offset = relative_offset; |
967 nav_info->navigation_index = | 968 nav_info->navigation_index = |
968 tab_contents_->tab_contents()->GetController().GetCurrentEntryIndex(); | 969 tab_contents_->tab_contents()->GetController().GetCurrentEntryIndex(); |
969 nav_info->url = entry->GetURL(); | 970 nav_info->url = entry->GetURL(); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 if (params.disposition == CURRENT_TAB) { | 1199 if (params.disposition == CURRENT_TAB) { |
1199 DCHECK(route_all_top_level_navigations_); | 1200 DCHECK(route_all_top_level_navigations_); |
1200 forward_params.disposition = NEW_FOREGROUND_TAB; | 1201 forward_params.disposition = NEW_FOREGROUND_TAB; |
1201 } | 1202 } |
1202 WebContents* new_contents = | 1203 WebContents* new_contents = |
1203 ExternalTabContainer::OpenURLFromTab(source, forward_params); | 1204 ExternalTabContainer::OpenURLFromTab(source, forward_params); |
1204 // support only one navigation for a dummy tab before it is killed. | 1205 // support only one navigation for a dummy tab before it is killed. |
1205 ::DestroyWindow(GetNativeView()); | 1206 ::DestroyWindow(GetNativeView()); |
1206 return new_contents; | 1207 return new_contents; |
1207 } | 1208 } |
OLD | NEW |