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/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "chrome/browser/chromeos/file_manager/open_util.h" | 9 #include "chrome/browser/chromeos/file_manager/open_util.h" |
10 #include "chrome/browser/platform_util_internal.h" | 10 #include "chrome/browser/platform_util_internal.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 else | 51 else |
52 message_id = IDS_FILE_BROWSER_ERROR_VIEWING_FILE; | 52 message_id = IDS_FILE_BROWSER_ERROR_VIEWING_FILE; |
53 break; | 53 break; |
54 | 54 |
55 case OPEN_FAILED_FILE_ERROR: | 55 case OPEN_FAILED_FILE_ERROR: |
56 message_id = IDS_FILE_BROWSER_ERROR_VIEWING_FILE; | 56 message_id = IDS_FILE_BROWSER_ERROR_VIEWING_FILE; |
57 break; | 57 break; |
58 } | 58 } |
59 | 59 |
60 Browser* browser = | 60 Browser* browser = |
61 chrome::FindTabbedBrowser(profile, false, chrome::HOST_DESKTOP_TYPE_ASH); | 61 chrome::FindTabbedBrowser(profile, false, ui::HOST_DESKTOP_TYPE_ASH); |
62 chrome::ShowMessageBox( | 62 chrome::ShowMessageBox( |
63 browser ? browser->window()->GetNativeWindow() : nullptr, | 63 browser ? browser->window()->GetNativeWindow() : nullptr, |
64 l10n_util::GetStringFUTF16(IDS_FILE_BROWSER_ERROR_VIEWING_FILE_TITLE, | 64 l10n_util::GetStringFUTF16(IDS_FILE_BROWSER_ERROR_VIEWING_FILE_TITLE, |
65 path.BaseName().AsUTF16Unsafe()), | 65 path.BaseName().AsUTF16Unsafe()), |
66 l10n_util::GetStringUTF16(message_id), chrome::MESSAGE_BOX_TYPE_WARNING); | 66 l10n_util::GetStringUTF16(message_id), chrome::MESSAGE_BOX_TYPE_WARNING); |
67 } | 67 } |
68 | 68 |
69 } // namespace | 69 } // namespace |
70 | 70 |
71 namespace internal { | 71 namespace internal { |
(...skipping 30 matching lines...) Expand all Loading... |
102 // which should handle this. However - there are two things which make it | 102 // which should handle this. However - there are two things which make it |
103 // necessary to keep it in: | 103 // necessary to keep it in: |
104 // a.) The user might have deleted the default handler in this session. | 104 // a.) The user might have deleted the default handler in this session. |
105 // In this case we would need to have this in place. | 105 // In this case we would need to have this in place. |
106 // b.) There are several code paths which are not clear if they would call | 106 // b.) There are several code paths which are not clear if they would call |
107 // this function directly and which would therefore break (e.g. | 107 // this function directly and which would therefore break (e.g. |
108 // "Browser::EmailPageLocation" (to name only one). | 108 // "Browser::EmailPageLocation" (to name only one). |
109 // As such we should keep this code here. | 109 // As such we should keep this code here. |
110 chrome::NavigateParams params(profile, url, ui::PAGE_TRANSITION_LINK); | 110 chrome::NavigateParams params(profile, url, ui::PAGE_TRANSITION_LINK); |
111 params.disposition = NEW_FOREGROUND_TAB; | 111 params.disposition = NEW_FOREGROUND_TAB; |
112 params.host_desktop_type = chrome::HOST_DESKTOP_TYPE_ASH; | 112 params.host_desktop_type = ui::HOST_DESKTOP_TYPE_ASH; |
113 | 113 |
114 if (url.SchemeIs("mailto")) { | 114 if (url.SchemeIs("mailto")) { |
115 std::string string_url = kGmailComposeUrl; | 115 std::string string_url = kGmailComposeUrl; |
116 string_url.append(url.spec()); | 116 string_url.append(url.spec()); |
117 params.url = GURL(url); | 117 params.url = GURL(url); |
118 } | 118 } |
119 | 119 |
120 chrome::Navigate(¶ms); | 120 chrome::Navigate(¶ms); |
121 } | 121 } |
122 | 122 |
123 } // namespace platform_util | 123 } // namespace platform_util |
OLD | NEW |