| 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/ui/extensions/app_metro_infobar_delegate_win.h" | 5 #include "chrome/browser/ui/extensions/app_metro_infobar_delegate_win.h" |
| 6 | 6 |
| 7 #include "apps/app_launch_for_metro_restart_win.h" | 7 #include "apps/app_launch_for_metro_restart_win.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/app_list/app_list_service_win.h" | 13 #include "chrome/browser/ui/app_list/app_list_service_win.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_finder.h" | 15 #include "chrome/browser/ui/browser_finder.h" |
| 16 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
| 17 #include "chrome/browser/ui/host_desktop.h" | 17 #include "chrome/browser/ui/host_desktop.h" |
| 18 #include "chrome/browser/ui/metro_chrome_win.h" | 18 #include "chrome/browser/ui/metro_chrome_win.h" |
| 19 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/common/url_constants.h" | 21 #include "content/public/common/url_constants.h" |
| 22 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 23 #include "grit/google_chrome_strings.h" | 23 #include "grit/google_chrome_strings.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | |
| 26 #include "win8/util/win8_util.h" | 25 #include "win8/util/win8_util.h" |
| 27 | 26 |
| 28 namespace chrome { | 27 namespace chrome { |
| 29 | 28 |
| 30 // static | 29 // static |
| 31 void AppMetroInfoBarDelegateWin::Create( | 30 void AppMetroInfoBarDelegateWin::Create( |
| 32 Profile* profile, Mode mode, const std::string& extension_id) { | 31 Profile* profile, Mode mode, const std::string& extension_id) { |
| 33 DCHECK(win8::IsSingleWindowMetroMode()); | 32 DCHECK(win8::IsSingleWindowMetroMode()); |
| 34 DCHECK_EQ(mode == SHOW_APP_LIST, extension_id.empty()); | 33 DCHECK_EQ(mode == SHOW_APP_LIST, extension_id.empty()); |
| 35 | 34 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 62 Mode mode, | 61 Mode mode, |
| 63 const std::string& extension_id) | 62 const std::string& extension_id) |
| 64 : ConfirmInfoBarDelegate(info_bar_service), | 63 : ConfirmInfoBarDelegate(info_bar_service), |
| 65 mode_(mode), | 64 mode_(mode), |
| 66 extension_id_(extension_id) { | 65 extension_id_(extension_id) { |
| 67 DCHECK_EQ(mode_ == SHOW_APP_LIST, extension_id_.empty()); | 66 DCHECK_EQ(mode_ == SHOW_APP_LIST, extension_id_.empty()); |
| 68 } | 67 } |
| 69 | 68 |
| 70 AppMetroInfoBarDelegateWin::~AppMetroInfoBarDelegateWin() {} | 69 AppMetroInfoBarDelegateWin::~AppMetroInfoBarDelegateWin() {} |
| 71 | 70 |
| 72 gfx::Image* AppMetroInfoBarDelegateWin::GetIcon() const { | 71 int AppMetroInfoBarDelegateWin::GetIconID() const { |
| 73 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 72 return chrome::GetAppListIconResourceId(); |
| 74 chrome::GetAppListIconResourceId()); | |
| 75 } | 73 } |
| 76 | 74 |
| 77 string16 AppMetroInfoBarDelegateWin::GetMessageText() const { | 75 string16 AppMetroInfoBarDelegateWin::GetMessageText() const { |
| 78 return l10n_util::GetStringUTF16(mode_ == SHOW_APP_LIST ? | 76 return l10n_util::GetStringUTF16(mode_ == SHOW_APP_LIST ? |
| 79 IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_APP_LIST : | 77 IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_APP_LIST : |
| 80 IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_PACKAGED_APP); | 78 IDS_WIN8_INFOBAR_DESKTOP_RESTART_FOR_PACKAGED_APP); |
| 81 } | 79 } |
| 82 | 80 |
| 83 string16 AppMetroInfoBarDelegateWin::GetButtonLabel( | 81 string16 AppMetroInfoBarDelegateWin::GetButtonLabel( |
| 84 InfoBarButton button) const { | 82 InfoBarButton button) const { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 content::OpenURLParams params( | 114 content::OpenURLParams params( |
| 117 GURL("https://support.google.com/chrome/?p=ib_redirect_to_desktop"), | 115 GURL("https://support.google.com/chrome/?p=ib_redirect_to_desktop"), |
| 118 content::Referrer(), | 116 content::Referrer(), |
| 119 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 117 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 120 content::PAGE_TRANSITION_LINK, false); | 118 content::PAGE_TRANSITION_LINK, false); |
| 121 web_contents()->OpenURL(params); | 119 web_contents()->OpenURL(params); |
| 122 return false; | 120 return false; |
| 123 } | 121 } |
| 124 | 122 |
| 125 } // namespace chrome | 123 } // namespace chrome |
| OLD | NEW |