Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1054)

Side by Side Diff: chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc

Issue 880313002: webui: add [lang] attribute to <html> element on all webui pages so (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cros Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h" 5 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
16 #include "chrome/browser/bookmarks/bookmark_stats.h" 16 #include "chrome/browser/bookmarks/bookmark_stats.h"
17 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" 17 #include "chrome/browser/bookmarks/chrome_bookmark_client.h"
18 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/enhanced_bookmarks/enhanced_bookmark_model_factory.h" 19 #include "chrome/browser/enhanced_bookmarks/enhanced_bookmark_model_factory.h"
19 #include "chrome/browser/extensions/api/bookmarks/bookmark_api_constants.h" 20 #include "chrome/browser/extensions/api/bookmarks/bookmark_api_constants.h"
20 #include "chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.h" 21 #include "chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.h"
21 #include "chrome/browser/extensions/extension_web_ui.h" 22 #include "chrome/browser/extensions/extension_web_ui.h"
22 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" 24 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h"
24 #include "chrome/browser/undo/bookmark_undo_service.h" 25 #include "chrome/browser/undo/bookmark_undo_service.h"
25 #include "chrome/browser/undo/bookmark_undo_service_factory.h" 26 #include "chrome/browser/undo/bookmark_undo_service_factory.h"
26 #include "chrome/common/extensions/api/bookmark_manager_private.h" 27 #include "chrome/common/extensions/api/bookmark_manager_private.h"
27 #include "chrome/common/pref_names.h" 28 #include "chrome/common/pref_names.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_INVALID_URL)); 512 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_INVALID_URL));
512 localized_strings->SetString("recent", 513 localized_strings->SetString("recent",
513 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_RECENT)); 514 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_RECENT));
514 localized_strings->SetString("search", 515 localized_strings->SetString("search",
515 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SEARCH)); 516 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SEARCH));
516 localized_strings->SetString("save", 517 localized_strings->SetString("save",
517 l10n_util::GetStringUTF16(IDS_SAVE)); 518 l10n_util::GetStringUTF16(IDS_SAVE));
518 localized_strings->SetString("cancel", 519 localized_strings->SetString("cancel",
519 l10n_util::GetStringUTF16(IDS_CANCEL)); 520 l10n_util::GetStringUTF16(IDS_CANCEL));
520 521
521 webui::SetFontAndTextDirection(localized_strings); 522 const std::string& app_locale = g_browser_process->GetApplicationLocale();
523 webui::SetLoadTimeDataDefaults(app_locale, localized_strings);
522 524
523 SetResult(localized_strings); 525 SetResult(localized_strings);
524 526
525 // This is needed because unlike the rest of these functions, this class 527 // This is needed because unlike the rest of these functions, this class
526 // inherits from AsyncFunction directly, rather than BookmarkFunction. 528 // inherits from AsyncFunction directly, rather than BookmarkFunction.
527 SendResponse(true); 529 SendResponse(true);
528 530
529 return true; 531 return true;
530 } 532 }
531 533
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 836
835 enhanced_bookmarks::EnhancedBookmarkModel* model = 837 enhanced_bookmarks::EnhancedBookmarkModel* model =
836 enhanced_bookmarks::EnhancedBookmarkModelFactory::GetForBrowserContext( 838 enhanced_bookmarks::EnhancedBookmarkModelFactory::GetForBrowserContext(
837 browser_context()); 839 browser_context());
838 model->SetVersionSuffix(params->version); 840 model->SetVersionSuffix(params->version);
839 841
840 return true; 842 return true;
841 } 843 }
842 844
843 } // namespace extensions 845 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698