Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Side by Side Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 160084: Chaos geolocation demo, non-WebKit part. Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/views/infobars/infobars.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/tab_contents/tab_contents.h" 5 #include "chrome/browser/tab_contents/tab_contents.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/jsmessage_box_handler.h" 28 #include "chrome/browser/jsmessage_box_handler.h"
29 #include "chrome/browser/load_from_memory_cache_details.h" 29 #include "chrome/browser/load_from_memory_cache_details.h"
30 #include "chrome/browser/load_notification_details.h" 30 #include "chrome/browser/load_notification_details.h"
31 #include "chrome/browser/omnibox_search_hint.h" 31 #include "chrome/browser/omnibox_search_hint.h"
32 #include "chrome/browser/password_manager/password_manager.h" 32 #include "chrome/browser/password_manager/password_manager.h"
33 #include "chrome/browser/plugin_installer.h" 33 #include "chrome/browser/plugin_installer.h"
34 #include "chrome/browser/profile.h" 34 #include "chrome/browser/profile.h"
35 #include "chrome/browser/renderer_host/render_widget_host_view.h" 35 #include "chrome/browser/renderer_host/render_widget_host_view.h"
36 #include "chrome/browser/renderer_host/resource_request_details.h" 36 #include "chrome/browser/renderer_host/resource_request_details.h"
37 #include "chrome/browser/renderer_host/web_cache_manager.h" 37 #include "chrome/browser/renderer_host/web_cache_manager.h"
38 #include "chrome/browser/tab_contents/geoloc_infobar_delegate.h"
38 #include "chrome/browser/tab_contents/infobar_delegate.h" 39 #include "chrome/browser/tab_contents/infobar_delegate.h"
39 #include "chrome/browser/tab_contents/interstitial_page.h" 40 #include "chrome/browser/tab_contents/interstitial_page.h"
40 #include "chrome/browser/tab_contents/navigation_entry.h" 41 #include "chrome/browser/tab_contents/navigation_entry.h"
41 #include "chrome/browser/tab_contents/provisional_load_details.h" 42 #include "chrome/browser/tab_contents/provisional_load_details.h"
42 #include "chrome/browser/tab_contents/tab_contents_delegate.h" 43 #include "chrome/browser/tab_contents/tab_contents_delegate.h"
43 #include "chrome/browser/tab_contents/tab_contents_view.h" 44 #include "chrome/browser/tab_contents/tab_contents_view.h"
44 #include "chrome/browser/tab_contents/thumbnail_generator.h" 45 #include "chrome/browser/tab_contents/thumbnail_generator.h"
45 #include "chrome/browser/thumbnail_store.h" 46 #include "chrome/browser/thumbnail_store.h"
46 #include "chrome/browser/search_engines/template_url_fetcher.h" 47 #include "chrome/browser/search_engines/template_url_fetcher.h"
47 #include "chrome/browser/search_engines/template_url_model.h" 48 #include "chrome/browser/search_engines/template_url_model.h"
48 #include "chrome/browser/shell_integration.h" 49 #include "chrome/browser/shell_integration.h"
49 #include "chrome/common/chrome_switches.h" 50 #include "chrome/common/chrome_switches.h"
50 #include "chrome/common/notification_service.h" 51 #include "chrome/common/notification_service.h"
51 #include "chrome/common/page_action.h" 52 #include "chrome/common/page_action.h"
52 #include "chrome/common/pref_names.h" 53 #include "chrome/common/pref_names.h"
53 #include "chrome/common/pref_service.h" 54 #include "chrome/common/pref_service.h"
54 #include "chrome/common/render_messages.h" 55 #include "chrome/common/render_messages.h"
55 #include "chrome/common/renderer_preferences.h" 56 #include "chrome/common/renderer_preferences.h"
56 #include "chrome/common/url_constants.h" 57 #include "chrome/common/url_constants.h"
57 #include "grit/generated_resources.h" 58 #include "grit/generated_resources.h"
58 #include "grit/locale_settings.h" 59 #include "grit/locale_settings.h"
59 #include "net/base/mime_util.h" 60 #include "net/base/mime_util.h"
60 #include "net/base/net_errors.h" 61 #include "net/base/net_errors.h"
61 #include "net/base/net_util.h" 62 #include "net/base/net_util.h"
62 #include "net/base/registry_controlled_domain.h" 63 #include "net/base/registry_controlled_domain.h"
64 #include "webkit/chaos/GeolocationPowerbox.h"
63 #include "webkit/glue/password_form.h" 65 #include "webkit/glue/password_form.h"
64 #include "webkit/glue/webpreferences.h" 66 #include "webkit/glue/webpreferences.h"
65 67
66 #if defined(OS_WIN) 68 #if defined(OS_WIN)
67 // For CRect 69 // For CRect
68 #include <atlbase.h> 70 #include <atlbase.h>
69 #include <atlapp.h> 71 #include <atlapp.h>
70 #include <atlmisc.h> 72 #include <atlmisc.h>
71 // TODO(port): some of these headers should be ported. 73 // TODO(port): some of these headers should be ported.
72 #include "chrome/browser/modal_html_dialog_delegate.h" 74 #include "chrome/browser/modal_html_dialog_delegate.h"
(...skipping 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after
2084 if (!select_file_dialog_.get()) 2086 if (!select_file_dialog_.get())
2085 select_file_dialog_ = SelectFileDialog::Create(this); 2087 select_file_dialog_ = SelectFileDialog::Create(this);
2086 SelectFileDialog::Type dialog_type = 2088 SelectFileDialog::Type dialog_type =
2087 multiple_files ? SelectFileDialog::SELECT_OPEN_MULTI_FILE : 2089 multiple_files ? SelectFileDialog::SELECT_OPEN_MULTI_FILE :
2088 SelectFileDialog::SELECT_OPEN_FILE; 2090 SelectFileDialog::SELECT_OPEN_FILE;
2089 select_file_dialog_->SelectFile(dialog_type, title, default_file, 2091 select_file_dialog_->SelectFile(dialog_type, title, default_file,
2090 NULL, 0, FILE_PATH_LITERAL(""), 2092 NULL, 0, FILE_PATH_LITERAL(""),
2091 view_->GetTopLevelNativeWindow(), NULL); 2093 view_->GetTopLevelNativeWindow(), NULL);
2092 } 2094 }
2093 2095
2096 void TabContents::ChooseGeolocationProvider(const GURL &url) {
2097 WebCore::GeolocationPowerbox::ProviderId provider_id
2098 = WebCore::GeolocationBrowserPowerbox::powerbox.findDecision(url);
2099 if (provider_id
2100 != WebCore::GeolocationPowerbox::NO_PROVIDER_FOUND) {
2101 GeolocationProviderChosen(provider_id);
2102 return;
2103 }
2104
2105 geolocation_url_ = url;
2106
2107 LOG(WARNING) << "Pop up infobar";
2108 AddInfoBar(new GeolocInfoBarDelegate(this));
2109 }
2110
2111 void TabContents::GeolocationProviderChosen(
2112 WebCore::GeolocationPowerbox::ProviderId provider_id) {
2113 WebCore::GeolocationBrowserPowerbox::powerbox.addDecision(geolocation_url_,
2114 provider_id);
2115 render_view_host()->GeolocationProviderChosen(provider_id);
2116 }
2117
2094 void TabContents::RunJavaScriptMessage( 2118 void TabContents::RunJavaScriptMessage(
2095 const std::wstring& message, 2119 const std::wstring& message,
2096 const std::wstring& default_prompt, 2120 const std::wstring& default_prompt,
2097 const GURL& frame_url, 2121 const GURL& frame_url,
2098 const int flags, 2122 const int flags,
2099 IPC::Message* reply_msg, 2123 IPC::Message* reply_msg,
2100 bool* did_suppress_message) { 2124 bool* did_suppress_message) {
2101 // Suppress javascript messages when requested and when inside a constrained 2125 // Suppress javascript messages when requested and when inside a constrained
2102 // popup window (because that activates them and breaks them out of the 2126 // popup window (because that activates them and breaks them out of the
2103 // constrained window jail). 2127 // constrained window jail).
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2414 NavigationController::LoadCommittedDetails& committed_details = 2438 NavigationController::LoadCommittedDetails& committed_details =
2415 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); 2439 *(Details<NavigationController::LoadCommittedDetails>(details).ptr());
2416 ExpireInfoBars(committed_details); 2440 ExpireInfoBars(committed_details);
2417 break; 2441 break;
2418 } 2442 }
2419 2443
2420 default: 2444 default:
2421 NOTREACHED(); 2445 NOTREACHED();
2422 } 2446 }
2423 } 2447 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/views/infobars/infobars.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698