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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(DriveOfflineNotificationDelegate); | 96 DISALLOW_COPY_AND_ASSIGN(DriveOfflineNotificationDelegate); |
97 }; | 97 }; |
98 | 98 |
99 void DriveOfflineNotificationDelegate::ButtonClick(int button_index) { | 99 void DriveOfflineNotificationDelegate::ButtonClick(int button_index) { |
100 DCHECK_EQ(0, button_index); | 100 DCHECK_EQ(0, button_index); |
101 | 101 |
102 // The support page will be localized based on the user's GAIA account. | 102 // The support page will be localized based on the user's GAIA account. |
103 const GURL url = GURL(kDriveOfflineSupportUrl); | 103 const GURL url = GURL(kDriveOfflineSupportUrl); |
104 | 104 |
105 chrome::ScopedTabbedBrowserDisplayer displayer( | 105 chrome::ScopedTabbedBrowserDisplayer displayer(profile_, |
106 profile_, | 106 ui::HOST_DESKTOP_TYPE_ASH); |
107 chrome::HOST_DESKTOP_TYPE_ASH); | |
108 chrome::ShowSingletonTabOverwritingNTP( | 107 chrome::ShowSingletonTabOverwritingNTP( |
109 displayer.browser(), | 108 displayer.browser(), |
110 chrome::GetSingletonTabNavigateParams(displayer.browser(), url)); | 109 chrome::GetSingletonTabNavigateParams(displayer.browser(), url)); |
111 } | 110 } |
112 | 111 |
113 //////////////////////////////////////////////////////////////////////////////// | 112 //////////////////////////////////////////////////////////////////////////////// |
114 // DriveWebContentsManager | 113 // DriveWebContentsManager |
115 | 114 |
116 // Manages web contents that initializes Google Drive offline mode. We create | 115 // Manages web contents that initializes Google Drive offline mode. We create |
117 // a background WebContents that loads a Drive endpoint to initialize offline | 116 // a background WebContents that loads a Drive endpoint to initialize offline |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 resource_bundle.GetImageNamed(IDR_NOTIFICATION_DRIVE), | 468 resource_bundle.GetImageNamed(IDR_NOTIFICATION_DRIVE), |
470 base::UTF8ToUTF16(extension->name()), GURL(), | 469 base::UTF8ToUTF16(extension->name()), GURL(), |
471 message_center::NotifierId(message_center::NotifierId::APPLICATION, | 470 message_center::NotifierId(message_center::NotifierId::APPLICATION, |
472 kDriveHostedAppId), | 471 kDriveHostedAppId), |
473 data, new DriveOfflineNotificationDelegate(profile_))); | 472 data, new DriveOfflineNotificationDelegate(profile_))); |
474 notification->set_priority(message_center::LOW_PRIORITY); | 473 notification->set_priority(message_center::LOW_PRIORITY); |
475 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 474 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); |
476 } | 475 } |
477 | 476 |
478 } // namespace chromeos | 477 } // namespace chromeos |
OLD | NEW |