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/extensions/extension_window_controller.h" | 5 #include "chrome/browser/extensions/extension_window_controller.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/extension_tabs_module_constants.h" | 8 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
9 #include "chrome/browser/extensions/extension_window_list.h" | 9 #include "chrome/browser/extensions/extension_window_list.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/base_window.h" | 11 #include "chrome/browser/ui/base_window.h" |
12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
13 | 13 |
14 /////////////////////////////////////////////////////////////////////////////// | 14 /////////////////////////////////////////////////////////////////////////////// |
15 // ExtensionWindowController | 15 // ExtensionWindowController |
16 | 16 |
17 ExtensionWindowController::ExtensionWindowController(BaseWindow* window, | 17 ExtensionWindowController::ExtensionWindowController(BaseWindow* window, |
18 Profile* profile) : | 18 Profile* profile) : |
19 window_(window), | 19 window_(window), |
20 profile_(profile) { | 20 profile_(profile) { |
21 ExtensionWindowList::GetInstance()->AddExtensionWindow(this); | 21 ExtensionWindowList::GetInstance()->AddExtensionWindow(this); |
22 } | 22 } |
23 | 23 |
24 ExtensionWindowController::~ExtensionWindowController() { | 24 ExtensionWindowController::~ExtensionWindowController() { |
25 ExtensionWindowList::GetInstance()->RemoveExtensionWindow(this); | 25 ExtensionWindowList::GetInstance()->RemoveExtensionWindow(this); |
26 } | 26 } |
27 | 27 |
28 Browser* ExtensionWindowController::GetBrowser() const { | 28 Browser* ExtensionWindowController::GetBrowser() const { |
29 return NULL; | 29 return NULL; |
30 } | 30 } |
31 | 31 |
32 namespace keys = extension_tabs_module_constants; | 32 namespace keys = extensions::tabs_constants; |
33 | 33 |
34 base::DictionaryValue* ExtensionWindowController::CreateWindowValue() const { | 34 base::DictionaryValue* ExtensionWindowController::CreateWindowValue() const { |
35 DictionaryValue* result = new DictionaryValue(); | 35 DictionaryValue* result = new DictionaryValue(); |
36 | 36 |
37 result->SetInteger(keys::kIdKey, GetWindowId()); | 37 result->SetInteger(keys::kIdKey, GetWindowId()); |
38 result->SetString(keys::kWindowTypeKey, GetWindowTypeText()); | 38 result->SetString(keys::kWindowTypeKey, GetWindowTypeText()); |
39 result->SetBoolean(keys::kFocusedKey, window()->IsActive()); | 39 result->SetBoolean(keys::kFocusedKey, window()->IsActive()); |
40 result->SetBoolean(keys::kIncognitoKey, profile_->IsOffTheRecord()); | 40 result->SetBoolean(keys::kIncognitoKey, profile_->IsOffTheRecord()); |
41 result->SetBoolean(keys::kAlwaysOnTopKey, window()->IsAlwaysOnTop()); | 41 result->SetBoolean(keys::kAlwaysOnTopKey, window()->IsAlwaysOnTop()); |
42 | 42 |
(...skipping 14 matching lines...) Expand all Loading... |
57 bounds = window()->GetRestoredBounds(); | 57 bounds = window()->GetRestoredBounds(); |
58 else | 58 else |
59 bounds = window()->GetBounds(); | 59 bounds = window()->GetBounds(); |
60 result->SetInteger(keys::kLeftKey, bounds.x()); | 60 result->SetInteger(keys::kLeftKey, bounds.x()); |
61 result->SetInteger(keys::kTopKey, bounds.y()); | 61 result->SetInteger(keys::kTopKey, bounds.y()); |
62 result->SetInteger(keys::kWidthKey, bounds.width()); | 62 result->SetInteger(keys::kWidthKey, bounds.width()); |
63 result->SetInteger(keys::kHeightKey, bounds.height()); | 63 result->SetInteger(keys::kHeightKey, bounds.height()); |
64 | 64 |
65 return result; | 65 return result; |
66 } | 66 } |
OLD | NEW |