| 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/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/renderer_preferences_util.h" | 20 #include "chrome/browser/renderer_preferences_util.h" |
| 21 #include "chrome/browser/tab_contents/tab_util.h" | 21 #include "chrome/browser/tab_contents/tab_util.h" |
| 22 #include "chrome/common/chrome_notification_types.h" | 22 #include "chrome/common/chrome_notification_types.h" |
| 23 #include "chrome/common/extensions/extension.h" | 23 #include "chrome/common/extensions/extension.h" |
| 24 #include "chrome/common/extensions/extension_constants.h" |
| 24 #include "chrome/common/extensions/extension_icon_set.h" | 25 #include "chrome/common/extensions/extension_icon_set.h" |
| 25 #include "chrome/common/jstemplate_builder.h" | 26 #include "chrome/common/jstemplate_builder.h" |
| 26 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 27 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 28 #include "content/public/browser/interstitial_page.h" | 29 #include "content/public/browser/interstitial_page.h" |
| 29 #include "content/public/browser/notification_types.h" | 30 #include "content/public/browser/notification_types.h" |
| 30 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 31 #include "grit/browser_resources.h" | 32 #include "grit/browser_resources.h" |
| 32 #include "grit/generated_resources.h" | 33 #include "grit/generated_resources.h" |
| 33 #include "net/base/escape.h" | 34 #include "net/base/escape.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return; | 137 return; |
| 137 NotifyBlockingPageComplete(false); | 138 NotifyBlockingPageComplete(false); |
| 138 } | 139 } |
| 139 | 140 |
| 140 void OfflineLoadPage::GetAppOfflineStrings( | 141 void OfflineLoadPage::GetAppOfflineStrings( |
| 141 const extensions::Extension* app, | 142 const extensions::Extension* app, |
| 142 const string16& failed_url, | 143 const string16& failed_url, |
| 143 DictionaryValue* strings) const { | 144 DictionaryValue* strings) const { |
| 144 strings->SetString("title", app->name()); | 145 strings->SetString("title", app->name()); |
| 145 | 146 |
| 146 GURL icon_url = app->GetIconURL(ExtensionIconSet::EXTENSION_ICON_LARGE, | 147 GURL icon_url = app->GetIconURL(extension_misc::EXTENSION_ICON_LARGE, |
| 147 ExtensionIconSet::MATCH_BIGGER); | 148 ExtensionIconSet::MATCH_BIGGER); |
| 148 if (icon_url.is_empty()) { | 149 if (icon_url.is_empty()) { |
| 149 strings->SetString("display_icon", "none"); | 150 strings->SetString("display_icon", "none"); |
| 150 strings->SetString("icon", string16()); | 151 strings->SetString("icon", string16()); |
| 151 } else { | 152 } else { |
| 152 // Default icon is not accessible from interstitial page. | 153 // Default icon is not accessible from interstitial page. |
| 153 // TODO(oshima): Figure out how to use default icon. | 154 // TODO(oshima): Figure out how to use default icon. |
| 154 strings->SetString("display_icon", "block"); | 155 strings->SetString("display_icon", "block"); |
| 155 strings->SetString("icon", icon_url.spec()); | 156 strings->SetString("icon", icon_url.spec()); |
| 156 } | 157 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 for (size_t i = 0; i < cell_networks.size(); ++i) { | 221 for (size_t i = 0; i < cell_networks.size(); ++i) { |
| 221 chromeos::ActivationState activation_state = | 222 chromeos::ActivationState activation_state = |
| 222 cell_networks[i]->activation_state(); | 223 cell_networks[i]->activation_state(); |
| 223 if (activation_state == ACTIVATION_STATE_ACTIVATED) | 224 if (activation_state == ACTIVATION_STATE_ACTIVATED) |
| 224 return false; | 225 return false; |
| 225 } | 226 } |
| 226 return true; | 227 return true; |
| 227 } | 228 } |
| 228 | 229 |
| 229 } // namespace chromeos | 230 } // namespace chromeos |
| OLD | NEW |