| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 const GURL url(endpoint_url_); | 214 const GURL url(endpoint_url_); |
| 215 content::WebContents::CreateParams create_params( | 215 content::WebContents::CreateParams create_params( |
| 216 profile_, content::SiteInstance::CreateForURL(profile_, url)); | 216 profile_, content::SiteInstance::CreateForURL(profile_, url)); |
| 217 | 217 |
| 218 web_contents_.reset(content::WebContents::Create(create_params)); | 218 web_contents_.reset(content::WebContents::Create(create_params)); |
| 219 web_contents_->SetDelegate(this); | 219 web_contents_->SetDelegate(this); |
| 220 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 220 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 221 web_contents_.get()); | 221 web_contents_.get()); |
| 222 | 222 |
| 223 content::NavigationController::LoadURLParams load_params(url); | 223 content::NavigationController::LoadURLParams load_params(url); |
| 224 load_params.transition_type = content::PAGE_TRANSITION_GENERATED; | 224 load_params.transition_type = ui::PAGE_TRANSITION_GENERATED; |
| 225 web_contents_->GetController().LoadURLWithParams(load_params); | 225 web_contents_->GetController().LoadURLWithParams(load_params); |
| 226 | 226 |
| 227 content::WebContentsObserver::Observe(web_contents_.get()); | 227 content::WebContentsObserver::Observe(web_contents_.get()); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void DriveWebContentsManager::StopLoad() { | 230 void DriveWebContentsManager::StopLoad() { |
| 231 started_ = false; | 231 started_ = false; |
| 232 } | 232 } |
| 233 | 233 |
| 234 void DriveWebContentsManager::OnOfflineInit( | 234 void DriveWebContentsManager::OnOfflineInit( |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 route_id, | 311 route_id, |
| 312 profile_, | 312 profile_, |
| 313 frame_name, | 313 frame_name, |
| 314 base::ASCIIToUTF16(app_id_), | 314 base::ASCIIToUTF16(app_id_), |
| 315 partition_id, | 315 partition_id, |
| 316 session_storage_namespace); | 316 session_storage_namespace); |
| 317 | 317 |
| 318 contents->web_contents()->GetController().LoadURL( | 318 contents->web_contents()->GetController().LoadURL( |
| 319 target_url, | 319 target_url, |
| 320 content::Referrer(), | 320 content::Referrer(), |
| 321 content::PAGE_TRANSITION_LINK, | 321 ui::PAGE_TRANSITION_LINK, |
| 322 std::string()); | 322 std::string()); |
| 323 | 323 |
| 324 // Return false as we already created the WebContents here. | 324 // Return false as we already created the WebContents here. |
| 325 return false; | 325 return false; |
| 326 } | 326 } |
| 327 | 327 |
| 328 void DriveWebContentsManager::Observe( | 328 void DriveWebContentsManager::Observe( |
| 329 int type, | 329 int type, |
| 330 const content::NotificationSource& source, | 330 const content::NotificationSource& source, |
| 331 const content::NotificationDetails& details) { | 331 const content::NotificationDetails& details) { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 base::UTF8ToUTF16(extension->name()), | 470 base::UTF8ToUTF16(extension->name()), |
| 471 message_center::NotifierId(message_center::NotifierId::APPLICATION, | 471 message_center::NotifierId(message_center::NotifierId::APPLICATION, |
| 472 kDriveHostedAppId), | 472 kDriveHostedAppId), |
| 473 data, | 473 data, |
| 474 new DriveOfflineNotificationDelegate(profile_))); | 474 new DriveOfflineNotificationDelegate(profile_))); |
| 475 notification->set_priority(message_center::LOW_PRIORITY); | 475 notification->set_priority(message_center::LOW_PRIORITY); |
| 476 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 476 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace chromeos | 479 } // namespace chromeos |
| OLD | NEW |