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/sidebar/sidebar_manager.h" | 5 #include "chrome/browser/sidebar/sidebar_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/extensions/extension_sidebar_api.h" | 11 #include "chrome/browser/extensions/extension_sidebar_api.h" |
12 #include "chrome/browser/prefs/pref_service.h" | |
13 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/tab_contents/tab_contents.h" | 13 #include "chrome/browser/tab_contents/tab_contents.h" |
15 #include "chrome/browser/sidebar/sidebar_container.h" | 14 #include "chrome/browser/sidebar/sidebar_container.h" |
16 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/common/notification_service.h" | 16 #include "chrome/common/notification_service.h" |
18 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
19 | 18 |
20 struct SidebarManager::SidebarStateForTab { | 19 struct SidebarManager::SidebarStateForTab { |
21 // Sidebars linked to this tab. | 20 // Sidebars linked to this tab. |
22 ContentIdToSidebarHostMap content_id_to_sidebar_host; | 21 ContentIdToSidebarHostMap content_id_to_sidebar_host; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 318 |
320 DCHECK(GetSidebarContainerFor(tab, content_id) == sidebar_host); | 319 DCHECK(GetSidebarContainerFor(tab, content_id) == sidebar_host); |
321 DCHECK(sidebar_host_to_tab_.find(sidebar_host)->second == tab); | 320 DCHECK(sidebar_host_to_tab_.find(sidebar_host)->second == tab); |
322 DCHECK(tab_to_sidebar_host_[tab].active_content_id != content_id); | 321 DCHECK(tab_to_sidebar_host_[tab].active_content_id != content_id); |
323 | 322 |
324 tab_to_sidebar_host_[tab].content_id_to_sidebar_host.erase(content_id); | 323 tab_to_sidebar_host_[tab].content_id_to_sidebar_host.erase(content_id); |
325 if (tab_to_sidebar_host_[tab].content_id_to_sidebar_host.empty()) | 324 if (tab_to_sidebar_host_[tab].content_id_to_sidebar_host.empty()) |
326 tab_to_sidebar_host_.erase(tab); | 325 tab_to_sidebar_host_.erase(tab); |
327 sidebar_host_to_tab_.erase(sidebar_host); | 326 sidebar_host_to_tab_.erase(sidebar_host); |
328 } | 327 } |
OLD | NEW |