OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/first_run/drive_first_run_controller.h" | 5 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "content/public/browser/navigation_controller.h" | 27 #include "content/public/browser/navigation_controller.h" |
28 #include "content/public/browser/notification_details.h" | 28 #include "content/public/browser/notification_details.h" |
29 #include "content/public/browser/notification_observer.h" | 29 #include "content/public/browser/notification_observer.h" |
30 #include "content/public/browser/notification_registrar.h" | 30 #include "content/public/browser/notification_registrar.h" |
31 #include "content/public/browser/notification_source.h" | 31 #include "content/public/browser/notification_source.h" |
32 #include "content/public/browser/notification_types.h" | 32 #include "content/public/browser/notification_types.h" |
33 #include "content/public/browser/render_frame_host.h" | 33 #include "content/public/browser/render_frame_host.h" |
34 #include "content/public/browser/site_instance.h" | 34 #include "content/public/browser/site_instance.h" |
35 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
36 #include "content/public/browser/web_contents_observer.h" | 36 #include "content/public/browser/web_contents_observer.h" |
| 37 #include "content/public/browser/web_contents_source.h" |
37 #include "extensions/browser/extension_registry.h" | 38 #include "extensions/browser/extension_registry.h" |
38 #include "extensions/browser/extension_system.h" | 39 #include "extensions/browser/extension_system.h" |
39 #include "extensions/common/extension.h" | 40 #include "extensions/common/extension.h" |
40 #include "extensions/common/extension_set.h" | 41 #include "extensions/common/extension_set.h" |
41 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
42 #include "ui/base/resource/resource_bundle.h" | 43 #include "ui/base/resource/resource_bundle.h" |
43 #include "ui/message_center/message_center.h" | 44 #include "ui/message_center/message_center.h" |
44 #include "ui/message_center/notification.h" | 45 #include "ui/message_center/notification.h" |
45 #include "ui/message_center/notification_delegate.h" | 46 #include "ui/message_center/notification_delegate.h" |
46 #include "url/gurl.h" | 47 #include "url/gurl.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 DriveWebContentsManager::~DriveWebContentsManager() { | 208 DriveWebContentsManager::~DriveWebContentsManager() { |
208 } | 209 } |
209 | 210 |
210 void DriveWebContentsManager::StartLoad() { | 211 void DriveWebContentsManager::StartLoad() { |
211 started_ = true; | 212 started_ = true; |
212 const GURL url(endpoint_url_); | 213 const GURL url(endpoint_url_); |
213 content::WebContents::CreateParams create_params( | 214 content::WebContents::CreateParams create_params( |
214 profile_, content::SiteInstance::CreateForURL(profile_, url)); | 215 profile_, content::SiteInstance::CreateForURL(profile_, url)); |
215 | 216 |
216 web_contents_.reset(content::WebContents::Create(create_params)); | 217 web_contents_.reset(content::WebContents::Create(create_params)); |
| 218 WebContentsSource::CreateForWebContentsAndLocation(web_contents_.get(), |
| 219 FROM_HERE); |
217 web_contents_->SetDelegate(this); | 220 web_contents_->SetDelegate(this); |
218 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 221 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
219 web_contents_.get()); | 222 web_contents_.get()); |
220 | 223 |
221 content::NavigationController::LoadURLParams load_params(url); | 224 content::NavigationController::LoadURLParams load_params(url); |
222 load_params.transition_type = ui::PAGE_TRANSITION_GENERATED; | 225 load_params.transition_type = ui::PAGE_TRANSITION_GENERATED; |
223 web_contents_->GetController().LoadURLWithParams(load_params); | 226 web_contents_->GetController().LoadURLWithParams(load_params); |
224 | 227 |
225 content::WebContentsObserver::Observe(web_contents_.get()); | 228 content::WebContentsObserver::Observe(web_contents_.get()); |
226 } | 229 } |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 resource_bundle.GetImageNamed(IDR_NOTIFICATION_DRIVE), | 469 resource_bundle.GetImageNamed(IDR_NOTIFICATION_DRIVE), |
467 base::UTF8ToUTF16(extension->name()), GURL(), | 470 base::UTF8ToUTF16(extension->name()), GURL(), |
468 message_center::NotifierId(message_center::NotifierId::APPLICATION, | 471 message_center::NotifierId(message_center::NotifierId::APPLICATION, |
469 kDriveHostedAppId), | 472 kDriveHostedAppId), |
470 data, new DriveOfflineNotificationDelegate(profile_))); | 473 data, new DriveOfflineNotificationDelegate(profile_))); |
471 notification->set_priority(message_center::LOW_PRIORITY); | 474 notification->set_priority(message_center::LOW_PRIORITY); |
472 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 475 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); |
473 } | 476 } |
474 | 477 |
475 } // namespace chromeos | 478 } // namespace chromeos |
OLD | NEW |