| 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/extensions/extension_menu_manager.h" | 5 #include "chrome/browser/extensions/extension_menu_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 checked_ = checked; | 85 checked_ = checked; |
| 86 return true; | 86 return true; |
| 87 } | 87 } |
| 88 | 88 |
| 89 void ExtensionMenuItem::AddChild(ExtensionMenuItem* item) { | 89 void ExtensionMenuItem::AddChild(ExtensionMenuItem* item) { |
| 90 item->parent_id_.reset(new Id(id_)); | 90 item->parent_id_.reset(new Id(id_)); |
| 91 children_.push_back(item); | 91 children_.push_back(item); |
| 92 } | 92 } |
| 93 | 93 |
| 94 const int ExtensionMenuManager::kAllowedSchemes = | 94 const int ExtensionMenuManager::kAllowedSchemes = |
| 95 URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS; | 95 URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS | |
| 96 URLPattern::SCHEME_HTTPSV; |
| 96 | 97 |
| 97 ExtensionMenuManager::ExtensionMenuManager() { | 98 ExtensionMenuManager::ExtensionMenuManager() { |
| 98 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, | 99 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, |
| 99 NotificationService::AllSources()); | 100 NotificationService::AllSources()); |
| 100 } | 101 } |
| 101 | 102 |
| 102 ExtensionMenuManager::~ExtensionMenuManager() { | 103 ExtensionMenuManager::~ExtensionMenuManager() { |
| 103 MenuItemMap::iterator i; | 104 MenuItemMap::iterator i; |
| 104 for (i = context_items_.begin(); i != context_items_.end(); ++i) { | 105 for (i = context_items_.begin(); i != context_items_.end(); ++i) { |
| 105 STLDeleteElements(&(i->second)); | 106 STLDeleteElements(&(i->second)); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 if (profile < other.profile) | 497 if (profile < other.profile) |
| 497 return true; | 498 return true; |
| 498 if (profile == other.profile) { | 499 if (profile == other.profile) { |
| 499 if (extension_id < other.extension_id) | 500 if (extension_id < other.extension_id) |
| 500 return true; | 501 return true; |
| 501 if (extension_id == other.extension_id) | 502 if (extension_id == other.extension_id) |
| 502 return uid < other.uid; | 503 return uid < other.uid; |
| 503 } | 504 } |
| 504 return false; | 505 return false; |
| 505 } | 506 } |
| OLD | NEW |