| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/offline/offline_load_page.h" | 5 #include "chrome/browser/chromeos/offline/offline_load_page.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/string_piece.h" | 12 #include "base/string_piece.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/chromeos/cros/cros_library.h" | 16 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 17 #include "chrome/browser/chromeos/cros/network_library.h" | 17 #include "chrome/browser/chromeos/cros/network_library.h" |
| 18 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
| 19 #include "chrome/browser/extensions/extension_system.h" | 19 #include "chrome/browser/extensions/extension_system.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/renderer_preferences_util.h" | 21 #include "chrome/browser/renderer_preferences_util.h" |
| 22 #include "chrome/browser/tab_contents/tab_util.h" | 22 #include "chrome/browser/tab_contents/tab_util.h" |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 24 #include "chrome/common/extensions/extension.h" | 25 #include "chrome/common/extensions/extension.h" |
| 25 #include "chrome/common/extensions/extension_constants.h" | 26 #include "chrome/common/extensions/extension_constants.h" |
| 26 #include "chrome/common/extensions/extension_icon_set.h" | 27 #include "chrome/common/extensions/extension_icon_set.h" |
| 27 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 28 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 29 #include "content/public/browser/interstitial_page.h" | 30 #include "content/public/browser/interstitial_page.h" |
| 30 #include "content/public/browser/notification_types.h" | 31 #include "content/public/browser/notification_types.h" |
| 31 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 32 #include "grit/browser_resources.h" | 33 #include "grit/browser_resources.h" |
| 33 #include "grit/generated_resources.h" | 34 #include "grit/generated_resources.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 return; | 139 return; |
| 139 NotifyBlockingPageComplete(false); | 140 NotifyBlockingPageComplete(false); |
| 140 } | 141 } |
| 141 | 142 |
| 142 void OfflineLoadPage::GetAppOfflineStrings( | 143 void OfflineLoadPage::GetAppOfflineStrings( |
| 143 const extensions::Extension* app, | 144 const extensions::Extension* app, |
| 144 const string16& failed_url, | 145 const string16& failed_url, |
| 145 DictionaryValue* strings) const { | 146 DictionaryValue* strings) const { |
| 146 strings->SetString("title", app->name()); | 147 strings->SetString("title", app->name()); |
| 147 | 148 |
| 148 GURL icon_url = app->GetIconURL(extension_misc::EXTENSION_ICON_LARGE, | 149 GURL icon_url = extensions::IconsInfo::GetIconURL( |
| 149 ExtensionIconSet::MATCH_BIGGER); | 150 app, |
| 151 extension_misc::EXTENSION_ICON_LARGE, |
| 152 ExtensionIconSet::MATCH_BIGGER); |
| 150 if (icon_url.is_empty()) { | 153 if (icon_url.is_empty()) { |
| 151 strings->SetString("display_icon", "none"); | 154 strings->SetString("display_icon", "none"); |
| 152 strings->SetString("icon", string16()); | 155 strings->SetString("icon", string16()); |
| 153 } else { | 156 } else { |
| 154 // Default icon is not accessible from interstitial page. | 157 // Default icon is not accessible from interstitial page. |
| 155 // TODO(oshima): Figure out how to use default icon. | 158 // TODO(oshima): Figure out how to use default icon. |
| 156 strings->SetString("display_icon", "block"); | 159 strings->SetString("display_icon", "block"); |
| 157 strings->SetString("icon", icon_url.spec()); | 160 strings->SetString("icon", icon_url.spec()); |
| 158 } | 161 } |
| 159 | 162 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 for (size_t i = 0; i < cell_networks.size(); ++i) { | 225 for (size_t i = 0; i < cell_networks.size(); ++i) { |
| 223 chromeos::ActivationState activation_state = | 226 chromeos::ActivationState activation_state = |
| 224 cell_networks[i]->activation_state(); | 227 cell_networks[i]->activation_state(); |
| 225 if (activation_state == ACTIVATION_STATE_ACTIVATED) | 228 if (activation_state == ACTIVATION_STATE_ACTIVATED) |
| 226 return false; | 229 return false; |
| 227 } | 230 } |
| 228 return true; | 231 return true; |
| 229 } | 232 } |
| 230 | 233 |
| 231 } // namespace chromeos | 234 } // namespace chromeos |
| OLD | NEW |