OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/translate/translate_infobar_delegate.h" | 5 #include "chrome/browser/translate/translate_infobar_delegate.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
11 #include "base/histogram.h" | |
12 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/profile.h" | 12 #include "chrome/browser/profile.h" |
14 #include "chrome/browser/tab_contents/tab_contents.h" | 13 #include "chrome/browser/tab_contents/tab_contents.h" |
15 #include "chrome/browser/translate/translate_infobar_view.h" | 14 #include "chrome/browser/translate/translate_infobar_view.h" |
16 #include "chrome/browser/translate/translate_manager.h" | 15 #include "chrome/browser/translate/translate_manager.h" |
17 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
18 #include "grit/theme_resources.h" | 17 #include "grit/theme_resources.h" |
19 | 18 |
20 // static | 19 // static |
21 TranslateInfoBarDelegate* TranslateInfoBarDelegate::CreateDelegate( | 20 TranslateInfoBarDelegate* TranslateInfoBarDelegate::CreateDelegate( |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 std::swap(offsets[0], offsets[1]); | 351 std::swap(offsets[0], offsets[1]); |
353 *swap_languages = true; | 352 *swap_languages = true; |
354 } else { | 353 } else { |
355 *swap_languages = false; | 354 *swap_languages = false; |
356 } | 355 } |
357 | 356 |
358 strings->push_back(text.substr(0, offsets[0])); | 357 strings->push_back(text.substr(0, offsets[0])); |
359 strings->push_back(text.substr(offsets[0], offsets[1] - offsets[0])); | 358 strings->push_back(text.substr(offsets[0], offsets[1] - offsets[0])); |
360 strings->push_back(text.substr(offsets[1])); | 359 strings->push_back(text.substr(offsets[1])); |
361 } | 360 } |
OLD | NEW |