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